I have this query and if it returns successful, I want another function to process, if not, do not process that function.
Here is the code for running the query
global $DB;
$status = $DB->query("UPDATE exp_members SET group_id = '$group_id' WHERE member_id = '$member_id'");
if($status == false)
{
die("Didn't Update");
}
If you are using mysql_query
in the backend (whatever $DB->query()
uses to query the database), it will return a TRUE
or FALSE
for INSERT
, UPDATE
, and DELETE
(and a few others), commands, based on their status.