sir
its give affected row zero tell me where is error in following code ?
<?php
$con = mysql_connect(" localhost","roo t","123456") ;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db ("my_db", $con);
$username = “comp”;
$passwd = “comp”;
$sql = "SELECT * FROM per
WHERE user_id = '".$username ."' AND password = '".$passwd." '";
$r=mysql_query( $sql);
if (!r)
{
die('Error: ' . mysql_error());
exit();
}
echo mysql_num_rows( $r);
$rs=mysql_num_r ows($r);
if($rs==0)
{
print "wrong";
exit();
}
else{
print "right";
//proceed to perform website’s functionality – e.g. present information to the user
}
mysql_close($co n)
?>
it will affected row 0 and wrong
sanjay
its give affected row zero tell me where is error in following code ?
<?php
$con = mysql_connect(" localhost","roo t","123456") ;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db ("my_db", $con);
$username = “comp”;
$passwd = “comp”;
$sql = "SELECT * FROM per
WHERE user_id = '".$username ."' AND password = '".$passwd." '";
$r=mysql_query( $sql);
if (!r)
{
die('Error: ' . mysql_error());
exit();
}
echo mysql_num_rows( $r);
$rs=mysql_num_r ows($r);
if($rs==0)
{
print "wrong";
exit();
}
else{
print "right";
//proceed to perform website’s functionality – e.g. present information to the user
}
mysql_close($co n)
?>
it will affected row 0 and wrong
sanjay
Comment