I'm trying to VIEW (print or echo) on the page the actual query that is being sent by the following:
$req1 = mysql_query('select m1.id, m1.title, m1.date_time, count(m2.id) as reps, users.username as userid, users.username from pm as m1, pm as m2,users where ((m1.user1="'.$_SESSION['username'].'" and m1.user1read="no" and users.id=m1.user2) or (m1.user2="'.$_SESSION['username'].'" and m1.user2read="no" and users.id=m1.user1)) and m1.id2="1" and m2.id=m1.id group by m1.id order by m1.id desc');
I've tried looking all over the net for a way to do this but "echo $req1" just returns a resource ID. Something is wrong, probably with the username variable, and it's returning no records. Could someone please explain how to get the actual QUERY, as it's running with username variables, etc. to print? I can't figure out how to do it.
Thank you in advance for your genuis!!! :)