主题:求助 num_row 问题
<?php
require("config.inc.php");
$connect = mysql_connect($dbhost,$dbuser,$dbpass)or die('无法连接服务器');;
mysql_select_db($db, $connect)or die('无法连接数据库');
$query = "select * from user where password = '".$password."'";
$result = mysql_query($query,$connect);
$num_row = mysql_num_rows($result);
if($num_row)
{
$info_login = mysql_fetch_array($result);
$username = $info_login[username];
$userpd = $info_login[password];
$id = $info_login[id];
session_register("username");
session_register("userpd");
session_register("id");
?>
上面代码运行的$num_row = mysql_num_rows($result); 的时候出错
输出$num_row返回的是0 但是我的数据库里有2条记录
请问这是什么错误 怎么改正谢谢
require("config.inc.php");
$connect = mysql_connect($dbhost,$dbuser,$dbpass)or die('无法连接服务器');;
mysql_select_db($db, $connect)or die('无法连接数据库');
$query = "select * from user where password = '".$password."'";
$result = mysql_query($query,$connect);
$num_row = mysql_num_rows($result);
if($num_row)
{
$info_login = mysql_fetch_array($result);
$username = $info_login[username];
$userpd = $info_login[password];
$id = $info_login[id];
session_register("username");
session_register("userpd");
session_register("id");
?>
上面代码运行的$num_row = mysql_num_rows($result); 的时候出错
输出$num_row返回的是0 但是我的数据库里有2条记录
请问这是什么错误 怎么改正谢谢