[SOLVED] inserting data into a mysql database
Posted: Thu Mar 04, 2004 4:17 pm
Here is my code. It says there is a parse error around line 20 but im not experienced to enough to see it.
Cheers
Code: Select all
<?php
$datetime = date("m.d.y\ H:i:s");
$Location = $_POST['Location'];
$Area = $_POST['Area'];
$Title = $_POST['Title'];
$Author = $_POST['Author'];
$Data = $_POST['Data'];
echo $Area;
$dbh=mysql_connect ("localhost", "xskate_reviews", "password") or die ('There was an error with the database: ' . mysql_error());
mysql_select_db ("xskate_reviews");
if ($Area == "Parks")
{
$query = "INSERT INTO `Parks` VALUES ('', '$Title', '$Location', '$Author', '$Data', NOW( ));"
}
if ($Area == "Street")
{
$query = "INSERT INTO `Street` VALUES ('', '$Title', '$Location', '$Author', '$Data', NOW( ));"
}
if ($Area == "Tricks")
{
$query = "INSERT INTO `Tricks` VALUES ('', '$Title', '$Author', '$Data', NOW( ) );"
}
mysql_query($query);
mysql_close();
?>