Hi, can anyone help:
This code only returns me the first 2 result sets - one from each table. I can't get it to loop. Some of these numbers are found in id in office and some of them in details but they should all be there from one or the other table. grateful for any help.
$query9 = "SELECT id FROM details WHERE id IN ('73','20','39','41','48','50','71','72') UNION SELECT id FROM office WHERE id IN ('73','20','39','41','48','50','71','72') AND id NOT IN (SELECT id FROM details);";
$result9 = mysql_query($query9, $recommendingpeople) or die(mysql_error());
$row9 = mysql_fetch_array($result9);
do {
echo $row9['id'];
} while ($row9 = mysql_fetch_assoc($result9));
$rows = mysql_num_rows($result9);
if($rows > 0) {
mysql_data_seek($result9, 0);
$row9 = mysql_fetch_assoc($result9);
}
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
thanks for the input, however that gets me even less info - just one result from the second table (office) in my select statement. (number 20 from the id's. where as with my way I get number 73 and 20) - but still missing the others - no looping. what 's missing?