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

a var dump shows as false

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.

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";

thats my point! put some there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.