For example I have a table with an id(primary key) and a name. User can either add a new row or update an existing row. One way is I can check whether the id is posted back, then I will update, otherwise it is a new record and I will insert. Is there a way to do it in one sql statement, like the ON DUPLICATE KEY UPDATE. Thanks.
Note: The reason I ask this is the primary key is auto-increment and it will be null when I retrieve it from the $_POST;