I have two queries like so,
$q = $dbc -> prepare("UPDATE accounts SET motivation = motivation+100 WHERE motivation <= maxMotivation-100");
$q -> execute();
$q = $dbc -> prepare("UPDATE accounts SET motivation = maxMotivation WHERE motivation > maxMotivation-100");
$q -> execute();
It basically ensures that a number cannot go over the max number allowed. But the problem is that it is going into a cronjob, so how can I do this in one statement? If the first fails then do the second or if the first succeeds skip the second. Is there a way with mysql if statements?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)