The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a point in the right direction
#20
Okay....last time I think haha

Trying to get it to where it won't update the DB again if you already have the boolean set as 1.

$db->query("UPDATE users SET on_break = CASE WHEN on_break = 0 THEN 1, ELSE 0 END WHERE id = ?",array($user->data()->id));

This actually ends up doing nothing as far as setting the on_break flag or not in the DB. I've tried if/thens wrapped around the $_POST['break_out]' but those don't seem to actually be able to pull the results correctly and I'm not getting anywhere there either. I tried doing a $db->query("SELECT * FROM users WHERE on_break = 1") where it saved the query as a variable, and then did if statements using if (is_bool === true) but, that wasn't working either.

Full code can be found at http://pastebin.com/nY5L3pbd if it helps clarify anything.

Basically I just don't want people to be able to continue clicking a button that they've already clicked.
  Reply


Messages In This Thread
Need a point in the right direction - by sandrews - 11-18-2016, 06:02 PM
Need a point in the right direction - by dan - 11-18-2016, 06:33 PM
Need a point in the right direction - by sandrews - 11-18-2016, 06:44 PM
Need a point in the right direction - by dan - 11-18-2016, 06:47 PM
Need a point in the right direction - by sandrews - 11-19-2016, 04:04 AM
Need a point in the right direction - by Brandin - 11-19-2016, 02:19 PM
Need a point in the right direction - by dan - 11-19-2016, 05:14 PM
Need a point in the right direction - by sandrews - 11-19-2016, 10:25 PM
Need a point in the right direction - by sandrews - 11-20-2016, 12:23 AM
Need a point in the right direction - by sandrews - 11-20-2016, 02:40 AM
Need a point in the right direction - by mudmin - 11-20-2016, 05:57 PM
Need a point in the right direction - by mudmin - 11-20-2016, 06:04 PM
Need a point in the right direction - by sandrews - 11-21-2016, 05:39 PM
Need a point in the right direction - by mudmin - 11-21-2016, 07:42 PM
Need a point in the right direction - by sandrews - 11-22-2016, 12:58 AM
Need a point in the right direction - by mudmin - 11-22-2016, 01:00 AM
Need a point in the right direction - by sandrews - 11-22-2016, 03:43 AM
Need a point in the right direction - by mudmin - 11-22-2016, 07:42 AM
Need a point in the right direction - by sandrews - 11-23-2016, 06:47 PM
Need a point in the right direction - by sandrews - 11-24-2016, 12:43 AM
Need a point in the right direction - by mudmin - 11-24-2016, 03:55 PM
Need a point in the right direction - by sandrews - 11-24-2016, 04:10 PM
Need a point in the right direction - by mudmin - 11-24-2016, 04:19 PM
Need a point in the right direction - by sandrews - 11-24-2016, 09:41 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)