But I'm still getting an error message;
here's the full query code
$query0 = "SELECT * FROM mb_consultants";
$result0 = mysql_query($query0)
OR die(mysql_error()); //for debugging
$num_rows = mysql_num_rows($result0);
$query1 = "SELECT *
FROM mb_consultants
WHERE consultant_id < '{$num_rows}'
ORDER BY rand()
LIMIT 1";
$result1 = mysql_query($query1)
OR die(mysql_error()); //for debugging
$db_result1 = mysql_fetch_array($result1);
// query for box 2
$query2 = "SELECT *
FROM mb_consultants
WHERE consultant_id < '{$num_rows}'
and consultant_id != '.$db_result1['consultant_id'].'
ORDER BY rand()
LIMIT 1";
$result2 = mysql_query($query2);
$db_result2 = mysql_fetch_array($result2);
I get the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/macboulder/html/index.php on line 52
line 52 is this line:
and consultant_id != '.$db_result1['consultant_id'].'
thanks again