Hi!
When I try to run the code below I get this error-message:
Parse error: syntax error, unexpected ';' in /customers/naturgym.se/naturgym.se/httpd.www/phpsqlinfo_addrow.php on line 29
I don't really know what's wrong with it. I would appreciate if anyone of you know-how guys out there could give me a helping hand. 🙂
Thanks alot!
//Oscar
<?php
require("phpsqlinfo_dbinfo.php");
$description = $_GET['description'];
$lat = $_GET['lat'];
$lng = $_GET['lng'];
$connection = mysql_connect ("localhost", $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
$query = sprintf("INSERT INTO markers " .
" (id, description, lat, lng ) " .
" VALUES (NULL, '%s', '%s', '%s');",
mysql_real_escape_string($description),
mysql_real_escape_string($lat),
mysql_real_escape_string($lng),
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>