what is wrong about this sniplet?
| From: | Jacky@lilst | Date: | Wed, 24 Jan 2001 17:17:11 +0000 |
| Subject: | what is wrong about this sniplet? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-36323@lists.php.net to get a copy of this message | ||
I have the sniplet to run teh query at the page to insert data as shown below. After it is run,
there was en error said something like
"Mysql warning, 0 ( zero) is not Mysql index" and the error point to the line using
mysql_insert_id($HotelID);
My limited experience cannot tell me what should I be doing in order to get what I need. Any
thought?
******************************************************
//insert Hotel detail
$insertHotel = "INSERT INTO Hoteldetail (HotelName,HotelLocation,
HotelCountry,HotelPostcode, HotelTelephone,Hotelfax,HotelURL,
HotelContactFirstName,HotelContactLastName, HotelRoomProvided, HotelEmail) VALUES
('$HotelName', '$HotelLocation', '$HotelCountry',
'$HotelPostcode', '$Hoteltelephone', '$Hotelfax',
'$HotelURL', '$HotelContactFirstName', '$HotelContactLastName',
'$HotelRoomProvided', '$HotelEmail')";
$resultHotel = mysql_query($insertHotel);
// retrive latest HotelID
$latestHotelID = mysql_insert_id($HotelID);
******************************************************
cheers
Jack
jacky@activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"