Jump to content

if statement


spearchilduser

Recommended Posts

$sql = mysql_query("SELECT * FROM quotes

WHERE (Firm_By_Customer=0 OR Firm_By_Customer=$userid) AND Firm_ID=0");

while($row = mysql_fetch_array($sql)){

$qid = $row["Quote_ID"];

$sq2 = mysql_query("SELECT * FROM bids

WHERE (Firm_ID=$id AND Quote_ID=$qid AND DeclienedByCustomer=1) OR (Firm_ID=$id AND Quote_ID=$qid)");

if(!mysql_fetch_array($sq2)){

$customer_Location = $row["Customer_Location"];

$customer_Destination = $row["Customer_Destination"];

$how_Many = $row["How_Many"];

$wait_Time = $row["Wait_Time"];

$pric = $row['Price'];

echo '<table border="0">

<tr>

<td>Customer Location </td><td><input readonly type= "text" name="Customer_Location" value="'.$customer_Location.'"></td>

<td>Customer Destination</td><td> <input readonly type= "text" name="Customer_Destination" value="'.$customer_Destination.'"></td>

<td>Customer can Wait</td><td> <input readonly type= "text" name="mins" maxlength="2" value="'.$wait_Time.' Minutes."></td>

<td>Customer are</td><td width="2px"> <input readonly type= "text" name="numb" value="'.$how_Many.' People."></td>

<td>Price</td><td> <input readonly type= "text" name="price" value="'.$pric.'"></td>

<td><a href="TaxiEntry1.php?Quote_ID='.$qid.'">Accept</a>  <a href="decline.php?Quote_ID='.$qid.'">Decline</a></td>

</tr>

</table><br />';}

} // close while

?>

</body>

</html>

 

is my code the user is accepting a job by clickign accept or declinign by selecting decline and i need to update the accept_decline field dependant on which link they choose

 

 

Link to comment
Share on other sites

hey thanks for the explination im trying to do the following

:

if(isset($_GET['flag'])){

  if($_GET['flag']== 'a'){

  mysql_query("UPDATE bids SET Firm_ID = '$firmid', DeclienedByCustomer= '0' WHERE Quote_ID=$qid") or die (mysql_error());

  mysql_query("UPDATE quotes SET Firm_ID = '$firmid', accept_Decline= '1' WHERE Quote_ID=$qid") or die (mysql_error());

  }

  else($_GET['flag']=='d'{

  mysql_query("UPDATE bids SET Firm_ID = '$firmid', DeclienedByCustomer= '1' WHERE Quote_ID=$qid") or die (mysql_error());

  mysql_query("UPDATE quotes SET Firm_ID = '$firmid', accept_Decline= '0' WHERE Quote_ID=$qid") or die (mysql_error());

  }

  else{

  echo "stop messing about with the address bar!";

  }

}

 

  } // close while

 

as its in a while loop and i need to update it in 2 different tables but it is saying

 

Parse error: parse error, unexpected '{' in E:\students\08023190\taxi\TaxiEntry.php on line 55

any ideas ?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.