hello friends
suppose we have 2 job to do with mySQL database with PHP
an insert:
[code=php]
$insertSQL1 = sprintf(“INSERT INTO table1 (id1, id2) VALUES (%s, %s)”,
GetSQLValueString($id1, “int”),
GetSQLValueString($id2, “int”));
$Result1 = mysql_query($insertSQL1, $db_con) or die();
then an update
[code=php]
$updateSQL1 = sprintf(“UPDATE table2 SET grouplist=%s, group_name=%s WHERE userID=%s”,
GetSQLValueString($groupID, “int”),
GetSQLValueString($g_name, “text”),
GetSQLValueString($ID, “int”));
$Result2 = mysql_query($updateSQL1, $db_con) or die();
it is very important to do both insert & update together
but if in any reason mysql stop response to second job insert will work but update won’t
how can I force PHP does not do 1 job if other has error?
thanks in advance