the_islander — 2011-04-06T15:43:58-04:00 — #1
I've got a few lines of code that check a user's id, then update a field in the database to '1'. Unfortunately its not working and wondering if someone can help troubleshoot:
Part 1 (in confirmaccount.php)
Part 2 (in usermodel.php)
public function updatePremiumCC($userid)
$sql = "UPDATE users SET ccdetails = '1' AND featured = '1' WHERE id = $userid";
anthonysterling — 2011-04-06T15:59:19-04:00 — #2
The code looks fine (sorta), do you receive any errors? What framework are you using? CodeIgniter ?
the_islander — 2011-04-06T16:19:06-04:00 — #3
Yep using the codeigniter framework. There are no errors shown either in logs or on screen. I've also made sure I have error messages on:
Is there something I can 'print' before the sql query goes off to check the $userid is there or something along those lines?
anthonysterling — 2011-04-06T16:24:17-04:00 — #4
Possibly, try ...
log_message('debug', 'Executing: ' . $sql);
Then check your logs.