mySQL Problem



Hi,

in one of my php-scripts is the following query (with an already open
db-connection):

$q = "INSERT INTO main (name, img, descr, from, size, format, cat,
host, link, date) VALUES ('$name', '$img', '$descr', '$user', '$size',
'$format', '$cat', '$host', '$link', '$date')" or die(mysql_error());

And when the query gets executed i get back the following error:

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 'from, size, format, cat, host, link, date) VALUES ('bla', '-',
'keine', 'Holgi',' at line 1

Whats wrong here?!

cheers

.



Relevant Pages

  • Re: mySQL Problem
    ... And when the query gets executed i get back the following error: ... You have an error in your SQL syntax; ... Actually, problem is proper quoting, not the format or anything else. ...
    (comp.lang.php)
  • Re: mySQL Problem
    ... And when the query gets executed i get back the following error: ... You have an error in your SQL syntax; ... corresponds to your MySQL server version for the right syntax to use ...
    (comp.lang.php)
  • Re: SQL REPLACE function does not work thru ADO/DAO/OLE layer
    ... It happened because REPLACE function is not a part of SQL syntax for the ... Access, but VBA function. ... query in a database and call it from the application as a stored procedure. ... > Microsoft DAO 3.6 ...
    (microsoft.public.vb.database.ado)
  • Re: Hierarchic tables in Queries ??
    ... I don't think there's anything you could want to know about hierarchies and ... > I'm used since several years to create tables, stored procs and inner ... > So, I can tell that I know SQL syntax a little bit, still I would need ... > The query would return only Groceries because Meat contains Ham and Tools ...
    (microsoft.public.sqlserver.programming)
  • Re: script to retrieve active users that are not in a specific OU
    ... You are using SQL syntax in your query, which is fine, but there is no way I ... ' Comma delimited list of attribute values to retrieve. ... container, assuming that is the only container in your domain with users. ...
    (microsoft.public.windows.server.scripting)