Here is the error: "Parse error: parse error, unexpected T_STRING in /home/spiralwe/public_html/add.php on line 8"
I have looked up the token T_STRING but can't find any references or syntax on it, looked on php.net.
I have tried using .= and all kinds of semicolons and quotes. I am very new at php, just starting actually and this is my first attempt at a guestbook. Passwords and such removed. I had removed lines between the code just to see if I could get the error to change line numbers, was doubting that it was really reading it.
Here is the code I've written
Code: Select all
if (isset($_POST['name' and 'email' and 'comments']) ) {
$connect=mysql_connect("localhost","","") OR
DIE('Unable to connect because:' mysql_error());
$db_select = @mysql_select_db("") OR DIE('Unable to select database' mysql_error());
$query = "insert into gbook (ID,name,email,comments) ";
$query .= "VALUES('','$name','$email','$comments')";
mysql_query($query) or die("Insert Failed");
}Traci'