182x Posted July 27, 2007 Share Posted July 27, 2007 Hey guys, I am trying to put values in the array as follows so they can be used for displaying a graph, the problem I am having is that if in one table there is a user called john instead of counting john as 11 in total it will count 8 from one table and 1 from another and display it this way. Just wondering how to solve this problem. $get = "SELECT Username, count(*) FROM table1 GROUP BY Username UNION ALL SELECT Username, count(*) FROM table2 GROUP BY Username "; $query = mysql_query($get, $link_id)or die(mysql_error()); while($row = mysql_fetch_array($query)) { $data[] = $row[1]; $leg[] = $row[0]; } Quote Link to comment 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.