Home > Backend Development > PHP Tutorial > 为什么小弟我的mysql_fetch_array()语句不能正常输出呢

为什么小弟我的mysql_fetch_array()语句不能正常输出呢

WBOY
Release: 2016-06-13 11:20:40
Original
727 people have browsed it

为什么我的mysql_fetch_array()语句不能正常输出呢?
[email protected]_connect("localhost","root","") or die ("链接错误");
mysql_select_db("newdb",$conn);
$sql="SELETE * FROM test";
$query=mysql_query($sql,$conn);
$array=mysql_fetch_array($query);
print_r($array);

?>










Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\WAMP5\wamp\www\test\file.php on line 6

MySQL php
------解决方案--------------------
$sql="SELECT * FROM test";
------解决方案--------------------
supplied argument is not a valid MySQL result resource  参数不是一个MYSQL结果资源
那就是你的SQL语句执行有问题
------解决方案--------------------
SELETE * FROM test
Copy after login

改为
SELECT * FROM test
Copy after login

------解决方案--------------------
编码没有统一,你的表是什么编码就加上
mysql_query("set name 你的编码");
且浏览器编码也要一致。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template