Re: warning 1 is not mysql result index

From: Date: Thu, 25 Jan 2001 08:58:35 +0000
Subject: Re: warning 1 is not mysql result index
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-36585@lists.php.net to get a copy of this message
> still did not work. Keep returning the same error when I do this: > $HotelName = mysql_fetch_row($resultHotel,1) or die(mysql_error()); what was your connection statement and query to the db? I would look to these ass the culprit.... heres an example : mysql_connect("localhost", "$username", "$pass" ); mysql_select_db( "$db_name") or die( print "Unable to select database"); $query1 =" SELECT * FROM $table WHERE ID=$last_id"; $result = MYSQL_QUERY($query1); $row = mysql_fetch_object ($result) $fname = $row->firstname; $dog_tag = $row->ID; Ofcourse you need to check for errors etc.. Good Luck!

« previous php.general (#36585) next »