sooty2006 Posted November 30, 2009 Share Posted November 30, 2009 i have been doing php for over 3 years now i have many sites. but this seams to be so simple but i just carnt get it to work.i am trying to show the most profit and the least profit.the most profit is fine i get using DESC but when you go to minus figures and i use ASC for getting the smallest figure it dosnt bring the smallest figure to screen.eg...-1-1000it will print -1 not the -1000 how do i get to print -1000?all help would be great! scott Link to comment Share on other sites More sharing options...
justsomeguy Posted November 30, 2009 Share Posted November 30, 2009 If that's coming from a database, what data type is the column? Link to comment Share on other sites More sharing options...
fulbish Posted December 1, 2009 Share Posted December 1, 2009 I think you are using a string data type for your values. If you are then you must parse it to an integer first before sorting the values. Link to comment Share on other sites More sharing options...
sooty2006 Posted December 1, 2009 Author Share Posted December 1, 2009 the data type for the colum is char(10)should i try to change to another format?bigint(10)? i have used before with storing numbers? Link to comment Share on other sites More sharing options...
Distortion Posted December 1, 2009 Share Posted December 1, 2009 just try 'int' that automatically sets to 11 if i recall correctly. I don't think you need more than that. Link to comment Share on other sites More sharing options...
sooty2006 Posted December 1, 2009 Author Share Posted December 1, 2009 i have edited my code a small bit and changed the table colum type to bigint and all has worked fine!see i told you it would of been simple, you always forget the obvious! thanks for all your help!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.