Hi, I have a bit of code that requests 4 seperate queries from different tables. It has to because certain info is contained on different ones. Is there any way of speeding it up or sending the mail in the background?
Code:
$result = mysqli_query($con,"SELECT * FROM bids WHERE quote_id='$id' ORDER BY quoted_price ASC LIMIT 1");
while($row = mysqli_fetch_array($result)) {
$lowest= $row['quoted_price'];
}
$result = mysqli_query($con,"SELECT * FROM bids WHERE quote_id='$id'");
while($row = mysqli_fetch_array($result)) {
$client= $row['client_id'];
$v.= $client.":";
$count++;
}
$a = explode(':', trim($v, ':'));
foreach ((array_unique($a)) as $value) {
//// Code goes here to get all lowest bid for job, compare it again lowest and email if they not the lowest"
$result = mysqli_query($con,"SELECT * FROM clients WHERE id='$value'");
while($row = mysqli_fetch_array($result)) {
$nameb= $row['name'];
$idb= $row['id'];
$passwordb= $row['password'];
$emailb= $row['email'];
$contactb= $row['contact'];
}
$result = mysqli_query($con,"SELECT * FROM bids WHERE quote_id='$id' AND client_id='$value' ORDER BY quoted_price ASC LIMIT 1");
while($row = mysqli_fetch_array($result)) {
$quote= $row['quoted_price'];
echo $nameb." lowest bid is ".$quote."<BR>";
}
///email the news and add link!
}
Thanks
Jules