I am sorry but I don't understand - mainly about the little but of 'error' code you gave me.
This is the full code that is called upon if a variable has "accept" in it.
It basically tells the one successful person they have got something, and ALL OTHERS in the list that they were rejected.
It's the REJECTED part that's causing the errors.
Code: Select all
$offer = mysql_query ("SELECT * FROM offers WHERE id = '$offerid'");
while ($rowoffer = mysql_fetch_object($offer))
{
$result = mysql_query ("SELECT email, firstname, lastname FROM users WHERE id = '$rowoffer->buyerid'");
while ($row = mysql_fetch_object($result))
{
$to = "$row->email";
$subject = "domain Offer Accepted";
$headers = "From: noreply@domain.co.uk";
$body = "** This email account is not monitored - please do not reply. **
Dear $row->firstname $row->lastname
An offer you have made on domain has been accepted. Please login to see which item you are being emailed about, and take necessary steps to despatch your item for theirs.
Best regards
domain
http://www.domain.co.uk
";
mail ($to, $subject, $body, $headers);
}
mysql_free_result($result);
}
mysql_free_result($offer);
$rejectoffer = mysql_query ("SELECT * FROM offers WHERE sellerprodid = '$sellerprodid' AND buyerprodid <> '$buyerprodid'");
while ($rowoffer = mysql_fetch_object($rejectoffer))
{
$result2 = mysql_query ("SELECT email, firstname, lastname FROM users WHERE id == '$rowoffer->buyerid'");
while ($row2 = mysql_fetch_object($result2))
{
$to = "$row2->email";
$subject = "domain Offer Rejected";
$headers = "From: noreply@domain.co.uk";
$body = "** This email account is not monitored - please do not reply. **
Dear $row2->firstname $row2->lastname
We are sorry to inform you that an offer you have made on domain has been rejected. Please login to see which item you are being emailed about.
Best regards
domain
http://www.domain.co.uk
";
mail ($to, $subject, $body, $headers);
}
mysql_free_result($result2);
}
mysql_free_result($rejectoffer);