Hi I have a problem, I have created a site that allows for a user to bid on property but cant get a code to work where it updates a current record in the database
Well let me look into my crystal ball too see your coding problem. If you have a problem, please post your code that you are having problems with. From this point i can tell you is to change method from get to post
<?php
if (!isset($_REQUEST['pricesoldfor']) && ($_REQUEST['propertyID']))
{die("<p>You have to complete all records before pressing add record.</p>\n");
}
$pricesoldfor=$_REQUEST['pricesoldfor'];
$propertyID=$_REQUEST['propertyID'];
if ($pricesoldfor!=""){
include 'dbconnect.php';
$sql="UPDATE property SET pricesoldfor WHERE propertyID = "$propertyID"";
mysql_query($sql) or die (mysql_error());
mysql_close($connection);
echo "bid of $pricesoldfor has been accepted";
}
else {
die("<p> You have not entered all of the required fields </p>\n");
}
?>
Sorry about that, this is the code i have so far but i cant see where i have went wrong, i have changed the form to look like this
<form id="MakeBid" action="MakeBid.php" method="post">
<input type="hidden" name="propertyID" value ="propertyID"/>
<div>Bid Now <input type="text" name="pricesoldfor"/></div>
<input type="submit" value="Update" />
</form>
$sql = "UPDATE property SET pricesoldfor = $pricesoldfor WHERE propertyID = '$propertyID'";
Thanks for the reply, i applied that to my code however I got this error
Parse error: syntax error, unexpected T_VARIABLE in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_v013362/public_html/case/MakeBid.php on line 83