You could try inserting it, and see if it succeeds.  If its fails, then you 
know you have to update it.


$sql= 'insert...'
$result = mysql_query($sql);
$sql = 'update...';


At 01:34 PM 4/26/2002 -0400, you wrote:
>Hi to all,
>I have a form where users can insert or update a record. Now the way I have
>it, can just only do one thing either update or insert a new record. What I
>would like to do is: if it is a new record, execute the insert statement
>else execute the update statement. I don't know if it is possible to do it
>in PHP.
>Any help is greatly appreciate
>Thanks in advanced!
>PHP Database Mailing List (
>To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to