Home > Backend Development > PHP Tutorial > 啊关于Mysql

啊关于Mysql

WBOY
Release: 2016-06-13 12:43:21
Original
879 people have browsed it

求助啊关于Mysql
这段代码搞了一下午了,求大神给看看代码有问题没有
经测试能正确连接数据库,就是while循环条件$row = mysql_fetch_array($result)这句返回的是false
代码中的sql查询语句贴到navcat里面也是正确的,返回结果有30多条吧,求指点啊

代码如下:

<br />
$con = mysql_connect($dbhost,$dbuser,$dbpass); <br />
if ($con) <br />
{ <br />
	mysql_select_db($dbname, $con);<br />
	$result = mysql_query("SELECT * FROM zzbus WHERE line_name='58路'",$con);<br />
	while($row = mysql_fetch_array($result))<br />
	{<br />
		echo($row[0];<br />
	}<br />
}<br />
Copy after login

php?mysql?
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