matthewbonline — 2011-08-31T08:35:03-04:00 — #1
What does this error mean?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sql' at line 1
what does near 'sql' mean?
It also says at line 1.
Line 1 just has <?php
anthonysterling — 2011-08-31T08:57:44-04:00 — #2
That's a message from your MySQL server, the line 1 it is indicating is line 1 of the SQL query you sent it.
matthewbonline — 2011-08-31T08:59:46-04:00 — #3
so you are saying it does not like
@mysql_query("insert into products(name, price) values($name, $price)");
$sql = "INSERT INTO products VALUES (null, '$name', '$price')";
i thought it might understand one of them so i included both lines of code.