Problem with date_format() in indirect MySQL query...

From: Date: Thu, 01 Nov 2001 11:36:40 +0000
Subject: Problem with date_format() in indirect MySQL query...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73143@lists.php.net to get a copy of this message
Hello! :) First off, please respond to me directly as I am not subscribed to the list. Thanks! :) Now then, I have a quick question I'm hoping someone can help me with. I have this class method: function query($sql, $type = 'obj') { if(!$result = @mysql_query($this->masl($sql))){ echo "Problem with query: <b><tt>$sql</tt></b>. " . mysql_error(); exit; } $objary = array(); if(@mysql_num_rows($result) > 0){ if($type == 'obj'){ while($object = @mysql_fetch_object($result)){ $objary[] = $object; } @mysql_free_result($result); }elseif($type == 'assoc'){ while($object = @mysql_fetch_assoc($result)){ $objary[] = $object; } @mysql_free_result($result); }else{ echo "Problem with type of query requested."; exit; } return $objary; }else{ return null; } } And this something like this query: $res = $this->query("select *, date_format(thedate, 'M d, Y') as dt, date_format(thedate, 'l:i p') as tm from thetable where foo = '$bar'"); Every other query I've executed in this fashion, I've been successful in retrieving the results. But, when I try doing something with the date_format function, when I try to print out the formatted date and time returned, I get the formats instead. Does anyone have any idea why, and any idea what I can do to rectify this? TIA! :) -- -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/

« previous php.general (#73143) next »