不能将标量值用作数组

时间:2014-09-16 10:34:12

标签: php arrays database wordpress scalar

我正在尝试访问db wp,但是从php,这是一个操作,我已经用相同的脚本做了很多次它,但这次我获得不能使用scalare值作为数组最近这段代码,为什么?我不明白。

$dbcnx = @mysql_connect('localhost', 'xxxxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxx');
if (!$dbcnx) {
  exit('<p>poroppoppopopero ' .
      'this is the time of war.</p>');
}

if (!@mysql_select_db('xxxxxxxxxxxxxxxx')) {
  exit('<p>Unable to locate the joke ' .
      'database at this time pe pe pe pe pe pe pe</p>');
}



$result= @mysql_query ("SELECT  * FROM wp_posts ORDER BY ID DESC LIMIT 0, 30");

    if (!$result){

            exit ('inserimento  non avvenuto'.mysql_error());

    }

    $cont1=1;
    $cont2=1; 
    $cont3=1; 

while ($row=mysql_fetch_array($result)){    


 $id[$cont1]= $row['ID'];

0 个答案:

没有答案