s*******e 发帖数: 1269 | 1 $sql="SELECT * FROM satalite WHERE itemnumber='$name' and id='$pass'";
$result=mysql_query($sql,$db);
$myrow = mysql_fetch_row($result);
if ($myrow)
{
echo"You are OK";
session_start();
session_register("satallite");
$user=$myrow["satallite"];
}
我得数据苦里面(mysql)即使 itemnumber id vrachar(30) 和用户输入的name and pass
一样,
那个if 条件也不能达到真1.
总是之行else. | m*******e 发帖数: 119 | 2 Most likely it is the query problem. the sql command may have problem. Try
this
$sql="SELECE * FROM satalite WHERE itemnumber=\"$name\" AND id=\"$pass\";";
try to add a degug line like:
echo $myrow;
to see what is the value in $myrow
pass
【在 s*******e 的大作中提到】 : $sql="SELECT * FROM satalite WHERE itemnumber='$name' and id='$pass'"; : $result=mysql_query($sql,$db); : $myrow = mysql_fetch_row($result); : if ($myrow) : { : echo"You are OK"; : session_start(); : session_register("satallite"); : $user=$myrow["satallite"]; : }
|
|