I tried this, and it failed.  Thank you for the suggestion!

----- Original Message -----
From: "Cody Phanekham" <[EMAIL PROTECTED]>
To: "Dan J. Rychlik" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; "Chris W. Parker" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 7:43 PM
Subject: RE: [PHP] SQL statement


> http://www.mysql.com/doc/en/Reserved_words.html
>
> [snip]
> 6.1.7 Is MySQL Picky About Reserved Words?
>
> A common problem stems from trying to create a table with column names
that use the names of datatypes or functions built into MySQL, such as
TIMESTAMP or GROUP. You're allowed to do it (for example, ABS is allowed as
a column name). However, by default, in function invocations no whitespace
is allowed between the function name and the following `(' character, so
that a function call can be distinguished from a reference to a column name.
> [/snip]
>
> try renaming the field timestamp to something else and see if that helps?
>
>
>
> > -----Original Message-----
> > From: Dan J. Rychlik [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, 24 September 2003 10:32
> > To: [EMAIL PROTECTED]; Chris W. Parker;
> > [EMAIL PROTECTED]
> > Subject: Re: [PHP] SQL statement
> >
> >
> > This didnt work as well.
> > SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y')
> > as formatted_ts
> > FROM custlogon;
> >
> > It caused my script to die and not execute at all....
> >
> > ----- Original Message -----
> > From: "Jennifer Goodie" <[EMAIL PROTECTED]>
> > To: "Dan J. Rychlik" <[EMAIL PROTECTED]>; "Chris W. Parker"
> > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 23, 2003 7:15 PM
> > Subject: RE: [PHP] SQL statement
> >
> >
> > > > Ive used this
> > > > $query = ("SELECT username, password, DATE_FORMAT(timestamp,
> > > > '%d%m%y')  FROM
> > > > custlogon");
> > > >
> > > > But I recieve unknown index timestamp.  *shrug*
> > > >
> > > >
> > > You are receiving the error on an array returned by
> > fetch_array?  If so,
> > it
> > > is because the index is "DATE_FORMAT(timestamp, '%d%m%y')",
> > not timestamp,
> > > which isn't so great.  You can see this by doing a print_r
> > on the array to
> > > see what is actually in it.  Use aliasing in your query to give it a
> > better
> > > index.
> > > "SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as
> > formatted_ts
> > > FROM custlogon" or something like that.
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
****************************************************************************
*********
> This e-mail, including any attachments to it, may contain confidential
and/or personal information.
> If you have received this e-mail in error, you must not copy, distribute,
or disclose it, use or take any action
> based on the information contained within it.
>
> Please notify the sender immediately by return e-mail of the error and
then delete the original e-mail.
>
> The information contained within this e-mail may be solely the opinion of
the sender and may not necessarily
> reflect the position, beliefs or opinions of Salmat on any issue.
>
> This email has been swept for the presence of computer viruses known to
Salmat's anti-virus systems.
>
> For more information, visit our website at  www.salmat.com.au.
>
****************************************************************************
*********
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to