Another (tricky) way to do it is to get the insert id of the newly created record, assuming you are entering a new row into the database. This can be used in two ways - to confirm that the row was created successfully, and to perform additional work on the entry or to link other tables to the new entry. The function, run after the insert query, is mysql_insert_id(), which will return 0 if no new id was created. You can get more info and some samples here:
PHP: mysql_insert_id - Manual
Another good method, which I often use, is to simply test if an error has been set. If the error id is 0, the previous command executed correctly, otherwise call the error handler... if (mysql_errno()) echo mysql_error;