Hello all,
Can anyone tell me why the following code isn't working?
$dbh = mysql_connect($ host,$user,$pas s) or die("Couldn't connect...");
$selected = mysql_select_db ($db,$dbh);
$name = $_GET['name'];
$state = $_GET['state'];
$desc = $_GET['desc'];
$lat = $_GET['lat'];
$lng = $_GET['lng'];
$result = mysql_query("IN SERT INTO re_cities (name, state, description,
lat, lng) VALUES ('$name','$stat e','$desc','$la t','$lng')");
The script doesn't die when I attempt to connect so I'm assuming that
isn't the problem. I'm pretty sure I also get a result because the
following code echoes "City Add Successful".
if ($result) {
echo "City Add Successful";
} else {
echo "City Add Unsuccessful";
}
However, the data doesn't show up in the database. Any suggestions?
Can anyone tell me why the following code isn't working?
$dbh = mysql_connect($ host,$user,$pas s) or die("Couldn't connect...");
$selected = mysql_select_db ($db,$dbh);
$name = $_GET['name'];
$state = $_GET['state'];
$desc = $_GET['desc'];
$lat = $_GET['lat'];
$lng = $_GET['lng'];
$result = mysql_query("IN SERT INTO re_cities (name, state, description,
lat, lng) VALUES ('$name','$stat e','$desc','$la t','$lng')");
The script doesn't die when I attempt to connect so I'm assuming that
isn't the problem. I'm pretty sure I also get a result because the
following code echoes "City Add Successful".
if ($result) {
echo "City Add Successful";
} else {
echo "City Add Unsuccessful";
}
However, the data doesn't show up in the database. Any suggestions?
Comment