PDA

View Full Version : how to make sure for sql syntax???


CstAn
11-29-2005, 01:28 PM
i want to ask to make sure that 2 or more syntax successful operated.
how should i make it?
i am using php.

for example:
i got two query that insert data into database. i must make sure that both query successful operated else make sure not data will enter to database.

help! thanks.

felgall
11-29-2005, 08:54 PM
In the code where you process if the second insert didn't work you then do a call to delete the first insert.

A better solution would be to use transaction processing with commit and rolback - see http://dev.mysql.com/doc/refman/5.0/en/commit.html for more details.