Re: [PHP-DB] changing datatypes in the query

2003-08-27 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED]
 On Tue, 2003-08-26 at 11:21, Matt Babineau wrote:
  Tough question (I think). I am pulling some numbers out of a data base,
  currently they are stored in a blob. When I try to order by user_hits
  desc it does a text ordering, not a numerical ordering. Is there a way
  to get it to do a numeric ordering?

 I think I answered my own question, I used CAST() to set the type in the
 ORDER BY statement.

 cast(s11.data as unsigned)

Here's a crazy idea. How about storing numerical data in a numerical column?

---John Holmes...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] changing datatypes in the query

2003-08-26 Thread Matt Babineau
Hi all-

Tough question (I think). I am pulling some numbers out of a data base,
currently they are stored in a blob. When I try to order by user_hits
desc it does a text ordering, not a numerical ordering. Is there a way
to get it to do a numeric ordering?

Thanks,
Matt

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] changing datatypes in the query

2003-08-26 Thread Matt Babineau
I think I answered my own question, I used CAST() to set the type in the
ORDER BY statement.

cast(s11.data as unsigned)

Thx to me!
Matt

On Tue, 2003-08-26 at 11:21, Matt Babineau wrote:
 Hi all-
 
 Tough question (I think). I am pulling some numbers out of a data base,
 currently they are stored in a blob. When I try to order by user_hits
 desc it does a text ordering, not a numerical ordering. Is there a way
 to get it to do a numeric ordering?
 
 Thanks,
 Matt

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php