Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out if insert is successful or not 1

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
I'm writing a script which will upload a CSV file and insert the records into a mysql database. Is there any way if I can find out for each insert whether or not the insert statement was successful? That way the user can act on any unsuccessful inserts.

Thanks in advance
 
Perfect - that's exactly what I was looking for. Thanks so much for that
 
Sorry, I know this is an old post. Just wondered if there's any way of getting an error code if the insert isn't successful? I see in phpMyAdmin if you try something and it fails it will say MySQL said blah blah blah. So I presume there is some way, do you know how?
 
If there was an error in the UPDATE query, then mysql_query() will return FALSE, and you can get the error number or string with mysql_errorno() and mysql_error(), respectively.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top