Jump to content

Logic error


182x

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.