Page 1 of 1

entry that allready exists

Posted: Wed May 09, 2007 1:19 pm
by sarris
hi there...
if i try to INSERT a record to a table that allready exists (according to primary key) i guess the procedure stops.
I am calling my sql querries with PHP...is there a way to be informed that "the record you tried to insert allready exists" ??

thanks in advnace

Posted: Thu May 10, 2007 3:20 am
by CoderGoblin
mysql_affected_rows can be used to check if the row is inserted. If not you have some form of error. You should be able to get this error with mysql_error or mysql_errno.