Ive used this $query = ("SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon");
But I recieve unknown index timestamp. *shrug* ----- Original Message ----- From: "Chris W. Parker" <[EMAIL PROTECTED]> To: "Dan J. Rychlik" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 7:07 PM Subject: RE: [PHP] SQL statement > Dan J. Rychlik <mailto:[EMAIL PROTECTED]> > on Tuesday, September 23, 2003 4:58 PM said: > > > I know its failing because php doesnt like the quotation before the > > format parameters. Ive tried to fix this without any luck. Any > > Ideas ? > > It's failing because the ' before the %d is closing the string. > > Here's how I work out SQL stuffs: > > $sql = "SELECT username\n" > ." , password\n" > ." , DATE_FORMAT(timestamp, '%d%m%y')\n" > ."FROM custlogon"; > > $query = ($sql); > > > Althought it looks like it takes a lot more time to write (which is > true) it looks great when you are debugging. > > echo "<pre>$sql</pre>"; > > > Alternatively you should be able to do this: > > $query = ("SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') > FROM custlogon"); > > > > chris. > > -- > 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