當我在我的文件search.php中查詢我的數據庫時,它只返回遇到的第一個結果。mysql LIKE在三次匹配時只返回一行
$qry = "SELECT business_id FROM business WHERE zip like '%91326%'";
$rs = mysql_query($qry);
$rec = mysql_fetch_array($rs);
echo $session->showContents($rec);
showContents僅僅是一個效用函數...
function showContents($array)
{
echo "<pre>";
print_r($array);
echo "</pre>";
}
showContents返回此:
Array
(
[0] => 3
[business_id] => 3
)
瘋狂的事情是,當我把同一個查詢中sqlbuddy它給了我:
business_id
3
5
6
我在一個損失