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/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to