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
Retrieving data from database
#1
Hello Smile

I am (still) not very well versed in php at all, but I fiddle with it anyway. I'll try to explain what I want to do.

I added a column to the users table named day. Every user has a day of the week in their profiles which is stored in that column.

Now I would like to show on a public page (in a sort of calendar) the number of people who have Monday or Tuesday, etc.
So if there are 5 users with Monday in their profile, I would like to show the number 5 on that calendar page (preferably on Monday).
If there are 2 people who have Wednesday in their profile, it shows 2 on the calendar page.

I'm sure something like that should be possible, but I cannot seem to get it right in UserSpice.

I think it probably should look like this more or less: $query = $db->query("SELECT * FROM users WHERE day = monday",array($day));
But then I don't know how to show/echo the results Sad

Can anyone please give me a hand with this?
  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: 3 Guest(s)