hey! my first post here! here goes...
here is the code;
$count = "4";
$db_result = mysql_query("SELECT offer FROM offers");
if ($row = mysql_fetch_array($db_result)) {
do {
$query = "SELECT * FROM requests WHERE offer = $row['offer']"; */ this is line 22 /*
$result = mysql_query($query);
$count++
} while($row = mysql_fetch_array($result));
};
here is the error;
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /var/www/users/semple/readerOffers/totals.php on line 22
here are the tables;
offers
id | offer
1 offer 1
2 offer 2
3 offer 3
requests
id | offer | date
1 offer 2 111111
2 offer 2 111111
3 offer 1 111111
4 offer 3 111111
explanation;
i am trying to make a loop that will loop through all the offers. then using 'offer' from the offers table select all the entries in the request table that relate to that specific offer.
ie;
$query4 = SELECT * from requests WHERE offer = "offer 1";
$result4 = mysql_query($query4);
$query5 = SELECT * from requests WHERE offer = "offer 2";
$result5 = mysql_query($query5);
$query6 = SELECT * from requests WHERE offer = "offer 3";
$result6 = mysql_query($query6);
ill then use mysql_numrows to find the total number of requests for each offer.
so... where am i going wrong?
thanks!
david*