This query will take data from two tables, (it will also compare mydata.cpa > targets.mytarget) then you collect them using the column name from that table.
1 2 3 |
$result5 = mysql_query("SELECT mydata.conversions,mydata.client,mydata.campaign,mydata.cpa,targets.mytarget FROM mydata,targets where (mydata.cpa>targets.mytarget AND mydata.client='$client') group by campaign"); |