Jump to content

Extremely Basic Error


kevh26

Recommended Posts

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;}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/201486-extremely-basic-error/
Share on other sites

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.