Re: record fetching error

From: Date: Mon, 13 Dec 2004 17:21:04 +0000
Subject: Re: record fetching error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-204195@lists.php.net to get a copy of this message
Ahmed Abdel-Aliem wrote: > hi > i have a table in my database which i try to fetch rows from it > > here is the code i am using > > @ $db = mysql_connect ($server, $user, $pass); > mysql_select_db($database); > $test_tr = mysql_query("select * from art WHERE Game_ID = '$Game_ID' > desc LIMIT 1"); http://php.net/mysql_num_rows > $record=mysql_fetch_array($test_tr); Or, simply use something like: if ($record != false){ > $ART_File_Name = $record['ART_File_Name']; > $Art_Status = $record['Art_Status']; > $Art_Creation_Date = $record['Art_Creation_Date']; > $Art_ID = $record['Art_ID']; } Read http://php.net/mysql_fetch_array > the problem is when there is no row with the given Game_ID, i get a mysql > error. > how can i get rid of that error !!!! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#204195) next »