Darkmatter5 Posted October 27, 2008 Share Posted October 27, 2008 I have this query $query=mysql_query("SELECT COUNT(member_id) FROM $dbnameprim.$pagedb WHERE mem_username='$username' OR mem_email='$email' ") or die(mysql_error()); Now how can I use this query to get the value of this query into a variable named $count? BTW if I manually substitute the variables in the query, the query gives me the result I expect. Quote Link to comment https://forums.phpfreaks.com/topic/130299-solved-count-question/ Share on other sites More sharing options...
rhodesa Posted October 27, 2008 Share Posted October 27, 2008 $result=mysql_query("SELECT COUNT(member_id) FROM $dbnameprim.$pagedb WHERE mem_username='$username' OR mem_email='$email' ") or die(mysql_error()); list($count) = mysql_fetch_array($result); echo $count; Quote Link to comment https://forums.phpfreaks.com/topic/130299-solved-count-question/#findComment-675762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.