biohazard35 Posted July 16, 2010 Share Posted July 16, 2010 I'm just now learning how to do PHP and I'm having trouble with a script I'm making. The script is: <?php $username="username"; $password="password"; $database="database"; $CoordX=$_POST['CoordX']; $CoordY=$_POST['CoordY']; $TypePlane=$_POST['TypePlane']; $Area=$_POST['Area']; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO tablename VALUES ('','$CoordX','$CoordY','$TypePlane','$Area'); mysql_query($query); mysql_close(); ?> When ever I try to submit the form that goes with it I get this error: Parse error: syntax error, unexpected $end in /home/zacsblog/public_html/insert.php on line 29 What is the problem?? Please help. Line 29 is the very end of the script. Link to comment https://forums.phpfreaks.com/topic/207991-parse-error-on-my-script/ Share on other sites More sharing options...
MockY Posted July 16, 2010 Share Posted July 16, 2010 Replace $query = "INSERT INTO tablename VALUES ('','$CoordX','$CoordY','$TypePlane','$Area'); with $query = "INSERT INTO tablename VALUES ('','$CoordX','$CoordY','$TypePlane','$Area')"; You are missing closing " Link to comment https://forums.phpfreaks.com/topic/207991-parse-error-on-my-script/#findComment-1087286 Share on other sites More sharing options...
Pikachu2000 Posted July 16, 2010 Share Posted July 16, 2010 You were missing the closing quote here: VALUES ('','$CoordX','$CoordY','$TypePlane','$Area')"; Link to comment https://forums.phpfreaks.com/topic/207991-parse-error-on-my-script/#findComment-1087288 Share on other sites More sharing options...
biohazard35 Posted July 16, 2010 Author Share Posted July 16, 2010 Thanks! Link to comment https://forums.phpfreaks.com/topic/207991-parse-error-on-my-script/#findComment-1087290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.