Re: mySQL Problem



On Nov 7, 6:19 pm, "Steve" <no....@xxxxxxxxxxx> wrote:
well !!! lo-and-behold!!! when you get your error message back THIS time,
you actually get a line number OTHER THAN 1 !!! now THAT would be helpful!
imagine too, that you echo this out to the browser, copy it, and paste it
directly into your mysql query browser...then execute it. even before then,
you might have discovered (since you can now READ IT) that there is
something wrong in the data you're inserting.


Having yelled that out, haven't you ever noticed that mysql (and so do
other
sql servers) specify precisely where the problem is - this time it
said:

near 'from, size, format, cat, host ...

.... so it was quite clear that it had had problem with "from".
Considering php and
queries code readability you are, of course, right, since a programmer
will much more
easily read the code formatted in the way you have, but considering
error information,
sql servers are pretty precise about where the problem occurred, code
being indented
or not.

don't let me throw you on that one...bad data is NOT the problem here. there
are things called RESERVED WORDS. one of those would be the word 'FROM'...as
in "select * FROM". if you had correctly formatted your sql statement, the
line number in error would have been line 6...a much better clue.

As for rude yelling about making mistakes with reserved words, that is
something that happens
to many people, even experienced, from time to time, so no need to get
upset about it. I once
named two variables in C like "od" and "do", and couldn't find out
what was wrong with it until
I realised it was the "do" keyword.
Finally, it is not "reserved" word in any sql, as you can indeed name
any field "from", as long
as you make the parser know it. For an example, this is totally legal:

select name, img, descr, "from", size, format from table;

just as long as you keep the double quotes around key words.

Cheers

.



Relevant Pages

  • Re: Export specification Data Types
    ... Apparantly there was some confusion going on between the redesigned export ... You must explicitly format an integer value to be an ... List of reserved words in Access 2002 and Access 2003 ... List of Microsoft Jet 4.0 reserved words ...
    (microsoft.public.access.queries)
  • Re: Exporting table containing dates
    ... suggestion and again Access is not liking the word "Format". ... "Ken Snell MVP" wrote: ... Now export this query instead of exporting your table. ... Problem names and reserved words in Access ...
    (microsoft.public.access.externaldata)
  • Re: Combo box problem
    ... Remove the fixed in the format so that it is blank ... "Tom" wrote: ... >> many other words are reserved words in ACCESS, ... >> List of Microsoft Jet 4.0 reserved words ...
    (microsoft.public.access.forms)
  • Re: Combo box problem
    ... Tom ... > What is the format for the field in tblOutput? ... > many other words are reserved words in ACCESS, ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.forms)
  • Re: Combo box problem
    ... What is the format for the field in tblOutput? ... List of reserved words in Access 2002 and Access 2003 ... >> Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.forms)