我不知道爲什麼我的代碼不會返回true
,while循環工作正常,但存在問題。PHP的MySQLi到PDO?
$PDO_result = $db_PDO->prepare("SELECT * FROM nnm_anime INNER JOIN nnm_anime_info ON nnm_anime.a_id = nnm_anime_info.a_id WHERE a_name LIKE '?%' ");
$PDO_result->bindParam(1, $pismenka[$i]);
$PDO_result->execute();
這裏的時候,我var_dump()
$PDO_result
我得到陣列一個項目,因此下面的while循環應該工作:
while($row = $PDO_result->fetch(PDO::FETCH_ASSOC))
但事實並非如此。
工作的MySQLi:
$result = mysqli_query($connect_to_db, "SELECT * FROM nnm_anime INNER JOIN nnm_anime_info ON nnm_anime.a_id = nnm_anime_info.a_id WHERE a_name LIKE '$pismenka[$i]%' ");
while($row = mysqli_fetch_array($result))
不重複%不能在Param ....,我有其他問題,然後他 –