Hi folks, I'm new to PHP and have been doing ASP so please bear with me I'm getting an empty query error, but I'm not trying to query the database, I'm trying to add records. Can someone tell me what Im doing wrong? It is indeed getting the info from the form and therefore getting the variable values it needs. I know this because I have a "Hello World!" print statement inside of the first "If" and it does print out, so this condidtional woks. so what's wrong? Thanks in advance Also, not that this script lives in a folder named admin, and the database lives in a folder called database. Both are in the same level under the root folder. Is my path for the database wrong? Here's the code <html> <head> </head> <body> <?php $dayname=$_POST['dayname']; $day=intval($_POST['day']); $month=intval($_POST['month']); $year=intval($_POST['year']); $title=$_POST['title']; $description=$_POST['description']; $cost=$_POST['cost']; $location=$_POST['location']; $contact=$_POST['contact']; $type=$_REQUEST["type"]; $con = mysql_connect("mysql","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Classes", $con); if ($type == "enter") { print "Hello, World!"; $result = mysql_query("INSERT INTO classes (dayname, day, month, year, title, description, cost, location, contact) VALUES ('$dayname', '$day', '$month', '$year', '$title', '$description', '$cost', '$location', '$contact')"); if (!mysql_query($SQL,$con)) { die('Error: ' . mysql_error()); } header ('location: enter.php'); } if ($type == "edit") { } if ($type == "delete") { } ?> </body> </html>