The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
Retrieving data from database
#37
Thanks. I'll certainly be checking out that video.

What I want to do with the regular days and random days is essentially the same as before (with just the days).
But by splitting it up I can filter the users better. Users who have the word Sunday in the column regular_days come to class on Sunday weekly, and users with Sunday in random_days don't ( they come irregularly).

But on the front-end I still want to show the total number of users who come on any given day, so it is clear if a class on a certain day is full or not.

My friend's query did just that. But I was wondering if his way of coding fits in with the UserSpice coding so it won't cause problems somewhere (as to me it looks different to what you did with the earlier code).

This is his query:

$count = $db->query("SELECT * FROM users WHERE regular_days = ? OR random_days = ?",array($days, $days))->count();

And this was yours:

function getCalendarDay($day,$spaces){ global $db;
$count = $db->query("SELECT day FROM users WHERE day = ?",array($day))->count();
  Reply


Messages In This Thread
Retrieving data from database - by LBC - 01-04-2019, 09:02 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 09:07 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 09:24 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 09:27 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 09:36 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 09:36 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 09:39 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 09:39 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 09:48 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 10:21 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 10:22 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 10:39 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 10:42 AM
RE: Retrieving data from database - by LBC - 01-04-2019, 10:44 AM
RE: Retrieving data from database - by mudmin - 01-04-2019, 10:45 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 09:12 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 09:23 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 09:43 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 09:58 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 09:59 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 10:04 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 10:06 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 10:14 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 10:31 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 10:35 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 10:39 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 10:40 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 10:49 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 10:54 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 11:05 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 11:06 AM
RE: Retrieving data from database - by mudmin - 01-10-2019, 11:07 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 11:14 AM
RE: Retrieving data from database - by LBC - 01-10-2019, 01:35 PM
RE: Retrieving data from database - by LBC - 01-13-2019, 01:37 PM
RE: Retrieving data from database - by mudmin - 01-13-2019, 01:50 PM
RE: Retrieving data from database - by LBC - 01-13-2019, 02:55 PM
RE: Retrieving data from database - by mudmin - 01-13-2019, 02:58 PM
RE: Retrieving data from database - by LBC - 01-13-2019, 03:04 PM
RE: Retrieving data from database - by mudmin - 01-14-2019, 10:20 AM
RE: Retrieving data from database - by LBC - 01-22-2019, 12:11 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:12 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 12:17 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:17 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:18 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 12:22 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:19 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:25 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 12:32 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:34 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 12:37 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 12:41 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 01:03 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 01:04 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 01:08 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 01:11 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 01:17 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 01:22 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 01:24 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 01:43 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 01:48 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 01:55 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 02:12 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 03:27 PM
RE: Retrieving data from database - by mudmin - 01-22-2019, 03:28 PM
RE: Retrieving data from database - by LBC - 01-22-2019, 03:36 PM
RE: Retrieving data from database - by LBC - 03-26-2019, 08:00 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)