Hi everyone, I have been trying to get this script to upload info to a mysql database but i get this error:
Code:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\FoxServ\www\admin\_debug_tmp.php on line 7
the code is as follows:
Code:
<?php
$connect = mysql_connect("localhost", "root", "dbpassword") or die("Database connection error");
mysql_select_db("magazine");
$query = "INSERT INTO authors
(firstName,lastName,username,password,email)
VALUES
($_POST['firstName'],$_POST['lastName'],$_POST['username'],$_POST['password'],$_POST['email'])";
$result = mysql_query($query) or die(mysql_error());
echo "Account created successfully<br>";
?>
I can't see any errors, I'm attempting to follow the example in the book (page 100) to insert data into the movie_type database, but have no clue to what the mistake might be, any clues.
Thanks in advance.