Current location: Hot Scripts Forums » Other Discussions » Database » MySql sort problem


MySql sort problem

Reply
  #1 (permalink)  
Old 07-01-09, 11:07 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
MySql sort problem

Hi there..

when I select form a mysql database and select
by a certain column this happens:

the rows contain: 1, 2, 3, 10, 12, 30


it's sorted like this: 1,10,12,2,3,30 how to get it sorted
the right way like it should be: 1,2,3,10,12,30


_j
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-01-09, 11:11 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
Make the field type INT rather than VARCHAR.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Problem NationVoice Database 2 04-29-08 06:26 AM
MYSQL Error - Date select problem vivabensmith PHP 2 10-16-07 04:02 AM
PHP or Mysql problem?? weilies PHP 1 08-01-05 01:29 AM
Php problem, Mysql fetch arrays (or something) xxvatarxx PHP 3 07-27-05 11:51 AM
Problem with a sort table js function tdubyou JavaScript 0 05-03-04 10:19 AM


All times are GMT -5. The time now is 02:47 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.