Re: SQL statement

From: Date: Wed, 24 Sep 2003 02:06:27 +0000
Subject: Re: SQL statement
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-163683@lists.php.net to get a copy of this message
* Thus wrote Dan J. Rychlik (drychlik@tcsconsult.com): > Well, we have a word for myself that over looks things and takes things > literal. Its called "pencil smoke" It means dump, dunce, and lost. > > Jennifer was right, their was an error in my SQL query. technically it was an error in the code not the query. > > SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') > as timestamp FROM custlogon; > > not as formatted_ts..... > > It worked fine even on zeus it tested fine. Glad to hear it worked. For future reference, however, it can be a lot easier to help you if you could provided some essential information about your problem, some things to keep in mind: - What is the error message. - Show some code that surrounds the line number in the error. - If a variable is causing the problem, explain how that variable gets assigned. So, If you would have posted a message something like: --- I get this error in my php script: Notice: Undefined index: timestamp in C:\Program Files\Apache Group\Apache2\htdocs\Ameriforms\admintool\includes\getlogonhist.php on line 44 My line 44 looks like this: <?php echo $row['timestamp'];?></font></td> The variable $row is filled in from a mysql_fetch_assoc() call And the query I'm executing is like this: SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon --- So instead of 21 emails sent back and forth with trial and errors. The problem would have been easily solved. HTH, Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#163683) next »