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
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.