|
Posted by Bryan on 09/23/06 02:15
Hello all,
Can anyone tell me why the following code isn't working?
$dbh = mysql_connect($host,$user,$pass) 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("INSERT INTO re_cities (name, state, description,
lat, lng) VALUES ('$name','$state','$desc','$lat','$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?
Navigation:
[Reply to this message]
|