I'm stumped. I'm doing a simple ajax form where the user will enter data and it will send the data to the server.
I've got the following code:
<?php
require("/mnt/library/configdb.php");
require("/mnt/library/accessdb.php");
db_config_utility();
db_connect();
//Assign passed parameters
$submitDate = $_POST['submitDate'];
$mname = $_POST['mname'];
$mid = $_POST['mid'];
$coffice = $_POST['coffice'];
$street = $_POST['street'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$lat = $_POST['lat'];
$lng = $_POST['lng'];
//Setting up sql call
$sql="INSERT INTO manholes(
submit_date,
manhole_name,
manhole_id,
central_office,
street,
city,
state,
zipcode,
latitude,
longitude
)
VALUES (
'$submitDate',
'$mname',
'$mid',
'$coffice',
'$street',
'$city',
'$state',
'$zipcode',
'$lat',
'$lng'
)";
echo("SQL: " . $sql);
//Making sql calls
mysql_query($sql);
?>
The data is getting to the server correctly as the echo prints out correctly. The server sends back a code 200
but does not place the data into the database. It also causes my ajax post to fall into the error function where the "SyntaxError: Unexpected token S
".
If I remove the echo then the error thrown is "SyntaxError: Unexpected end of input
"
Any advice on how to find what is causing the problem?