0

Hi all,

Im failing to see why this record wont update......

$sql = "UPDATE tbl_sellers SET propertytype = '$propertytype', propertyaddress = '$propertyaddress', propadd2 = '$propadd2', proptown = '$proptown', propstatecounty = '$propstatecounty', proppostzip = '$proppostzip', propcountry = '$propcountry', propbedrooms = '$propbedrooms', propgarage = '$propgarage', eighteenplus = '$eighteenplus' WHERE ID = $prop_id";
$result = mysql_query($sql);
if (!$result) { echo("ERROR: " . mysql_error() . "\n$sql\n");	}
echo "thanks";
?>

when ran, the following is given, but im baffled :-/ (the id 20 does exist in the table

ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 UPDATE tbl_sellers SET propertytype = 'House
', propertyaddress = 'jhgjhgjhg
', propadd2 = 'jhgjhgjgh
', proptown = 'jgjghjgh
', propstatecounty = 'jhgjhgjgh
', proppostzip = 'jghjhgjhg
', propcountry = '
', propbedrooms = 'jhgjhgjhg
', propgarage = 'Yes
', eighteenplus = '
' WHERE ID = 20
2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by JRM
0

when ran, the following is given, but im baffled :-/ (the id 20 does exist in the table

WHERE ID = $prop_id";

no "ticks" around the variable.

0

hi thanks for the response.

there are no ticks around it

$sql = "UPDATE tbl_sellers propertytype = '$propertytype', 
				propertyaddress = '$propertyaddress', 
				propadd2 = '$propadd2', 
				proptown = '$proptown', 
				propstatecounty = '$propstatecounty', 
				proppostzip = '$proppostzip', 
				propcountry = '$propcountry', 
				propbedrooms = '$propbedrooms', 
				propgarage = '$propgarage', 
				eighteenplus = '$eighteenplus'
				WHERE ID = $prop_id";
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.