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();
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();