very strange problem for mysql query
| From: | JIM | Date: | Wed, 31 Oct 2001 06:42:36 +0000 |
| Subject: | very strange problem for mysql query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13879@lists.php.net to get a copy of this message | ||
hi,
i found very strange problem on mysql query. here is my code and result...
very strange!
pls help ...! thanks,....
* code *******************
<?
$link=mysql_pconnect("192.168.0.101", "chaze", "apple") or die
("failed");
mysql_select_db("stjohn");
$query="select * from user a, data b where a.room_num = b.room_num and
a.room_num = " . $room_num;
$result=mysql_query($query);
//$row=mysql_num_rows($result);
$row=mysql_fetch_object($result);
if ($row->id != $id)
{
printf("wrong id!");
header("location:http://www.php.net");
mysql_close($link);
exit();
}
printf("update: %s, room no.: %s<br>", $row->update_time, $row->room_num );
printf("update: %s, room no.: %s<br>", $row->update_time, $row->room_num );
printf("%s %s $s<br>", $row->name, $row->room_num, $row->update_time);
printf("%s %s $s<br>", $row->name, $row->update_time, $row->room_num);
mysql_close($link);
?>
* result *******************
update: 20011029120609, room no.: 9001
update: 20011029120609, room no.: 9001
jim lo 9001
jim lo 20011029120609