我想根據數組獲取mysql結果。根據數組獲取mysql結果
我有這樣的代碼,但它帶來的一個結果,並重復它,我希望所有的結果
$connectdb = mysql_connect('localhost','root','') or die('nonno');
$selectdb = mysql_select_db('test',$connectdb) or die('fofofo');
$se_right = mysql_query("select * from ads ") or die(mysql_error());
$row = mysql_fetch_object($se_right);
$array = array(
"id" => $row->id,
"name" => $row->adsurl
);
$se_ridght = mysql_query("select * from ads ") or die(mysql_error());
while($roww = mysql_fetch_object($se_ridght))
{
foreach($array as $key =>$results)
{
echo $key.':'.$results.'<br />';
}
}
你用數組來表示什麼意思? –