kevh26 Posted May 12, 2010 Share Posted May 12, 2010 Hi I'm getting the Parse error: syntax error, unexpected T_STRING error for line 16 of the below coding, it's only a simple script to import values from a Post action on a previous form into a MySQL database, but for some reason or another... i just can't figure out why this won't work: <?php $empno = $_Post['HRNo']; $surname = $_Post['name']; $course = $_Post['Test']; $score = $_Post['Accuracy']; $coursedate = $_Post['date']; mysql_connect ("localhost", "root", "11001001") or die ('Error: ' . mysql_error()); mysql_select_db ("elearning"); $query="INSERT INTO details (HRNo, name, test, accuracy, date)VALUES ('".$empno."', '".$surname."', '".$course."', '".$score."', '".$coursedate."') mysql_query($query) or die ('Error updating database'); {echo "Database Updated With: ".$empno." ".$surname." ".$course;} ?> Quote Link to comment https://forums.phpfreaks.com/topic/201486-extremely-basic-error/ Share on other sites More sharing options...
trq Posted May 12, 2010 Share Posted May 12, 2010 Any reason you decided posted your code so small we can't read it? Quote Link to comment https://forums.phpfreaks.com/topic/201486-extremely-basic-error/#findComment-1057051 Share on other sites More sharing options...
PFMaBiSmAd Posted May 12, 2010 Share Posted May 12, 2010 Line 12 is missing a closing quote and a semi-colon - "; Quote Link to comment https://forums.phpfreaks.com/topic/201486-extremely-basic-error/#findComment-1057053 Share on other sites More sharing options...
kevh26 Posted May 13, 2010 Author Share Posted May 13, 2010 Sorry Thorpe, click subscript to show it as being separate from the question, probably better options though! PFMaBiSmAd, thanks for that, i knew it'd be something completely obvious... only issue i've got now is getting it to connect to localhost, i'm not sure if i've set up my MySQL server and database correctly so that a PHP script on a website will connect ok, or if it's even possible! Quote Link to comment https://forums.phpfreaks.com/topic/201486-extremely-basic-error/#findComment-1057711 Share on other sites More sharing options...
cyberRobot Posted May 13, 2010 Share Posted May 13, 2010 Sorry Thorpe, click subscript to show it as being separate from the question, probably better options though! Yep, just click the button that has the # on it or . Both will place the selected code into a box that looks different from the rest of the message. Quote Link to comment https://forums.phpfreaks.com/topic/201486-extremely-basic-error/#findComment-1057729 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.