I have created an online form and am trying to post the info into a mysql database and I keep getting back a query error.
Below is my PHP code. If anybody can help me, that would be great.
Thanks a lot.
<?php
$property_type = $_POST['property_type'];
$number_of_bedrooms = $_POST['#_of_bedrooms'];
$number_of_bathrooms = $_POST['#_of_bathrooms'];
$state_province = $_POST['state_province'];
$city = $_POST['city'];
$address = $_POST['address'];
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$additional_info = $_POST['additional_info'];
$dbc = mysqli_connect('localhost', 'circlema_shnips6', 'rhiannon', 'circlema_propertydatabase')or die('Error connecting to MySql server');
$query = "INSERT INTO circlema_propertydatabase (property_type, number_of_bedrooms, number_of_bathrooms, state_province, city, address, " .
"name, email, phone, additional_info) " .
"VALUES ('$property_type', '$number_of_bedrooms', '$number_of_bathrooms', '$state_province', '$city', '$address', " .
"'$name', '$email', '$phone', '$additional_info')";
$result = mysqli_query($dbc, $query) or die('Error querying database.');
mysqli_close($dbc);
?>