我被困在一个非常基本的 sql 查询脚本中。Mybe有人可以注意到我看不到的东西。我检查了从 mysqladmin 执行的 sql 查询是否正常:
<?
include ('gps_db_connect.php');
$query = "SELECT * from gps WHERE server_time > '20130124'";
echo $query;
$result = mysqli_query($connection, $query) or die(' Error getting data');
echo ' After query';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo $row['server_time'];
}
?>
这是屏幕显示/输出:
SELECT * from gps WHERE server_time > '20130124' After
query
PHP Error Message
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a9440109/public_html/test.php on line 7