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
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
Retrieving data from database - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: Retrieving data from database (/showthread.php?tid=1288)

Pages: 1 2 3 4 5 6 7


RE: Retrieving data from database - mudmin - 01-04-2019

Absolutely. Happy to help. If any of it doesn't make sense, let me know. I can help with the sign up or whatever you need.


RE: Retrieving data from database - LBC - 01-04-2019

(01-04-2019, 10:22 AM)mudmin Wrote: Absolutely. Happy to help. If any of it doesn't make sense, let me know.  I can help with the sign up or whatever you need.

How would I go about it to get it like this:

Monday: 4
Tuesday: 6
Wednesday: ..
Thursday: ..
Friday: ..
Saturday: ..
Sunday: ..

Is there a line of code that i can just paste anywhere?


RE: Retrieving data from database - mudmin - 01-04-2019

Sure. Get rid of the entire table from <table to /table and paste this
https://pastebin.com/n0v0hQTC


RE: Retrieving data from database - LBC - 01-04-2019

Wow! So simple...geeze Blush 

I'll definitely get back to you for that sign up, but I'm going to try it by myself first.

Thanks again mudmin!


RE: Retrieving data from database - mudmin - 01-04-2019

Sure. No problem at all. And that's definitely the benefit of defining the days and writing that function. Once you have it, you can really do whatever you want with it.


RE: Retrieving data from database - LBC - 01-10-2019

Hello Mudmin,

Would it be possible to drop the weekday and just display the number of that particular weekday somewhere?
Like...hide the weekday or something?

I would like to display the number of spots available in a table.
Something like this:

Day                 | Time     | Activity | Spots available
Wednesday     | 19:00   | yoga     |  3
Friday              | 10:00   | yoga     |  5


RE: Retrieving data from database - mudmin - 01-10-2019

Let me see if I can help you a little better.
When I see that table, you're going from Wed to Friday. Are you saying that you want to only show days that have availability?

So Thursday has no days available, so it's skipped?

Also, do you expect to have multiple activities?


RE: Retrieving data from database - LBC - 01-10-2019

no no, this was just a quick example.

It should be all days of the week...showing availability of each weekday.
And yes, there will be several activities (Eventually). I will have to add extra columns to the users table for that.

What would be great if I could just echo the availability numbers of any particular event anywhere i want Smile


RE: Retrieving data from database - mudmin - 01-10-2019

Ok. So the way you're doing it will make it a little trickier to be more dynamic. Like what if you don't want to offer any dodgeball on Sundays or something like that? Do you want help making it dynamic?


RE: Retrieving data from database - mudmin - 01-10-2019

(01-10-2019, 09:58 AM)mudmin Wrote: Ok.  So the way you're doing it will make it a little trickier to be more dynamic.  Like what if you don't want to offer any dodgeball on Sundays or something like that? Do you want help making it dynamic?

Or I can just write the function to edit the table.