Multiple querys in one
How can i edit the following query so that it is as it is currently, BUT also selecting only those where a record exists in t_dj (t_dj user_id and t_user user_id is the same)
$result = mysql_query("SELECT * FROM t_user WHERE group_radio='1' ORDER BY second_name ASC");
SELECT U.* FROM t_user U, t_dj DJ WHERE U.group_radio='1' AND DJ.user_id = U.user_id ORDER BY U.second_name ASC
Thanks very much for that. Thats almost perfect!
Ive got the below query:-
mysql_query("SELECT t_user.* FROM t_user,t_dj WHERE t_user.group_radio AND t_dj.user_id = t_user.id ORDER BY rand() LIMIT 8");
BUT in the t_dj table there are sometime multiple records for the same user.
USER ID 0001, SHOW ID 0005
USER ID 0002, SHOW ID 0005
USER ID 0001, SHOW ID 0006
(Basically if a user is on more than one show [radio])
How can i change it so that it does pretty much the same, but i only want it to select each USER ID once.. Would i have to run this through another query?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)