geebo Posted November 11, 2007 Share Posted November 11, 2007 Well, thanks to Daukan I no longer get an error message with my php script, but unfortunately, no data gets posted to the database So, I am guessing that the connection to the database is successful, but something is not working after that. Here is my script again: <?php $name=$HTTP_POST_VARS['Name']; $date=$HTTP_POST_VARS['Date_']; $comments=$HTTP_POST_VARS['Comments']; $username="garyboha_*******"; $password="*******"; $database="garyboha_eortutorial"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); mysql_query($query); $query = "INSERT INTO eorresults (name, date, comments) VALUES ('$name', '$date', '$comments')"; mysql_close(); ?> Here is my php admin panel for the database: This should be simple. Thanks in advance for helping a total noob (and I mean noob on this one). Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 11, 2007 Share Posted November 11, 2007 you run mysql_query() on $query before $query is defined. add or die(mysql_error()) and you'll see this. mysql_query($query) or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
geebo Posted November 11, 2007 Author Share Posted November 11, 2007 Makes sense, one must define a query before one can run a query. Thanks for the help. MUCH APPRECIATED! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.