问题描述
在我遇到麻烦之前,我已经在
PHP文档,在线等广泛搜索了这个。
我有一个简单的页面:
<?php
$ un =" jim";
$ pw =" jim" ;;
$ db =" localhost";
$ link = mysql_connect($ db,$ un,$ pw)或die("无法连接:。
mysql_error());
$ sql2 =" SELECT * FROM eib.book ORDER BY bookid;
$ op = mysql_query($ sql2);
$ num = mysql_numrows($ op);
?>
当我运行页面时,我不断收到此错误:
警告:mysql_numrows():提供的参数不是有效的MySQL结果
资源C:\ Program Files \Apache
Group \Apache2 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ />
我不知道为什么?
代码看起来很好。
谢谢
Jim
Before I get in trouble, I have searched extensively for this one, in the
PHP Docs, online etc.
I have a simple page:
<?php
$un="jim";
$pw="jim";
$db="localhost";
$link = mysql_connect($db,$un,$pw) or die("Could not connect: " .
mysql_error());
$sql2 = "SELECT * FROM eib.book ORDER BY bookid";
$op = mysql_query($sql2) ;
$num= mysql_numrows($op);
?>
When I run the page I keep getting this error:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in C:\Program Files\Apache
Group\Apache2\htdocs\eib\php\itemadd2.php on line 34
I can''t work out why?
The code looks fine to me.
Thanks
Jim
http://jimpix.co.uk
推荐答案
这篇关于提供的参数不是有效的MySQL结果资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!