我有用於選擇和打印值的代碼。 mysql_numn_rows返回null:/選擇PHP和MySQL不能正常工作
<?php
mysql_connect('localhost','root','');
mysql_select_db("db2517");
$username = "Cristoforo";
$query = mysql_query("SELECT * users WHERE username='$username' ");
$numberOfRows = mysql_num_rows($query);
echo "num: $numberOfRows";
?>
忘記從後*添加,SELECT * FROM用戶......... – Exprator
查詢應該是這樣=的mysql_query(「SELECT * FROM用戶WHERE username ='$ username'「); –