Hi there AliTaylor4411,
Welcome to the Forum :) [
webmasterworld.com ]
Another issue I notice is this:-
$_POST[propertytype] they all need to be: $_POST[
'propertytype']
and I'm pretty sure that the insert statement is formatted wrong, try it like this:-
INSERT INTO `table_name` (`col1`, `col2`, `col3`) VALUES ('value1','value2','value3');
So your statement would look like this:-
$sql = "INSERT INTO `property`
(`YOUR_COLUMN`, `NAMES`, `HERE`)
values ('',
'".$_POST['propertyadd1']."',
'".$_POST['propertyadd2']."',
'".$_POST['propertyadd3']."',
'".$_POST['postcode']."',
'".$_POST['propertytype']."',
'".$_POST['bedrooms']."',
'".$_POST['price']."',
'".$_POST['agentid']."',
'".$_POST['garage']."',
'".$_POST['conservatory']."',
'".$_POST['swimmingpool']."',
'".$_POST['description']."',
'".$_POST['property_details']."') ";
That looks better anyway ;) Obviously substitute the column names with what corresponds with the values.
Oh, and with using the $_POST array directly into mysql, you will need to sanitise the data first, so functions like mysql_real_escape_string() & strip_tags() applied to the post array will make the sql more secure against malicuios code attacks..
Hope that helps.
Cheers,
MRb