select join table on mysql

From: Date: Wed, 05 Dec 2001 21:14:52 +0000
Subject: select join table on mysql
Groups: php.general 
Request: Send a blank email to php-general+get-76667@lists.php.net to get a copy of this message
hi i have to select this : $t2=mysql_db_query($db, "SELECT radacct.UserName,sum(radacct.AcctSessionTime) as t1,usergroup.GroupName ". "from radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName where". "usergroup.GroupName='unlimited' AND radacct.AcctStartTime>='2001-$month-01 00:00:00'". "AND AcctStopTime<='2001-$month-31 23:59:59' group by UserName"); when i do it in mysql database it already give me result and thereis about 400 rows. but when i want to generate it fetch the array there is a error Supplied argument is not a valid MySQL result resource in <b>./stats.php</b> on line (bellow is the line $x=mysql_fetch_array($t2); what might be possible wrong with the code..(it just a simple one) Yamin Prabudy

« previous php.general (#76667) next »