Re: SQL statement

From: Date: Wed, 24 Sep 2003 00:31:33 +0000
Subject: Re: SQL statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163668@lists.php.net to get a copy of this message
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" <goodie@apollointeractive.com> To: "Dan J. Rychlik" <drychlik@tcsconsult.com>; "Chris W. Parker" <cparker@swatgear.com>; <php-general@lists.php.net> 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. >

« previous php.general (#163668) next »