$sql = "INSERT INTO comments (from,user,date) VALUES ('$from', '$date', '$name')";
You have an error in your SQL syntax near 'from,user,date) VALUES ('pinehead', 'Monday, Oct, 13', '')' at line 1
That is my error.
Any ideas? Thank you - Anthony
not sure if this is going to help but try this
$sql = "INSERT INTO comments (from, user, date) VALUES ('".$from."', '".$date."', '".$name."')";
"from" is a mysql reserved word. You need to alter it....
or else use from -- note the backticks.
from
hrmmm.....I'd change it. Just to ensure no headaches later on when SELECTing from FROM someTable
Definatly change it. Using reserved keywords leads to hard to track down problems, headaches, and spending weekends coding 🙂
Originally posted by jon3k Definatly change it. Using reserved keywords leads to hard to track down problems, headaches, and spending weekends coding 🙂
Hrmm....I already spend weekends coding.....
Originally posted by LordShryku Hrmm....I already spend weekends coding.....
me too....
Originally posted by Moonglobe me too....
Tis the mark of the geek 😃
You also are sending data to mysql in a different order than your specifying: (from,user,date) VALUES ('$from', '$date', '$name')
should be: (from,user,date) VALUES ('$from', '$name', '$date')