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]; } Link to comment https://forums.phpfreaks.com/topic/62110-logic-error/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.