1 2 3 4 5 6 7 8 9 10 11 |
$query = "SELECT * FROM (SELECT campaign from targets where client='".$pc_id."' AND enabled !='disabled' UNION SELECT groupname AS campaign FROM clientcombine WHERE client='$pc_id') AS campaign"; |
Then just collect CAMPAIGN as your row.
1 2 3 4 5 6 7 8 |
$query = "SELECT * FROM (SELECT targetcpa AS targetcpa,client FROM targets WHERE client='Dog' UNION SELECT campaign,client from mydata where date="2014-04-07" AND client='Dog')"; AS campaign |
This above code will combine two sets of data(one from each table) into one….
Or this
1 2 3 4 5 6 |
$result = mysql_query("SELECT * FROM tasks JOIN residents ON residents.id = tasks.forwho WHERE tasks.id = '$taskid' "); |