ORDER BY for ints

2005-09-27 Thread Stephen A. Cochran Lists
I'm getting a strange ordering when using ORDER BY on a int column. The rows are being returned sorted as follows: 1 10 11 12 13 14 15 2 3 4 5 6 7 8 9 I'm sure this is a simple one, but I haven't found an answer in the archives. Thanks, Steve -- MySQL General Mailing List For list

Re: ORDER BY for ints

2005-09-27 Thread Jigal van Hemert
Stephen A. Cochran Lists wrote: I'm getting a strange ordering when using ORDER BY on a int column. The rows are being returned sorted as follows: The list is typically the way to order a string. You are most likely to get meaningful suggestions to solve the mystery if you include the

Re: ORDER BY for ints

2005-09-27 Thread Stephen A. Cochran Lists
On Sep 27, 2005, at 2:58 AM, Jigal van Hemert wrote: You are most likely to get meaningful suggestions to solve the mystery if you include the table definition (output of SHOW CREATE TABLE tablename) and the query. mysql SHOW CREATE TABLE Player| +

Re: ORDER BY for ints

2005-09-27 Thread Jasper Bryant-Greene
Stephen A. Cochran Lists wrote: On Sep 27, 2005, at 2:58 AM, Jigal van Hemert wrote: You are most likely to get meaningful suggestions to solve the mystery if you include the table definition (output of SHOW CREATE TABLE tablename) and the query. mysql SHOW CREATE TABLE Player| | Player

Re: ORDER BY for ints

2005-09-27 Thread Stephen A. Cochran Lists
On Sep 27, 2005, at 3:29 AM, Jasper Bryant-Greene wrote: mysql SHOW CREATE TABLE Player| | Player | CREATE TABLE `Player` ( `id` int(16) NOT NULL auto_increment, `first_name` varchar(32) NOT NULL default '', `last_name` varchar(32) NOT NULL default '', `year` varchar(16) NOT NULL

Re: ORDER BY for ints

2005-09-27 Thread Michael Stassen
Stephen A. Cochran Lists wrote: On Sep 27, 2005, at 3:29 AM, Jasper Bryant-Greene wrote: mysql SHOW CREATE TABLE Player| | Player | CREATE TABLE `Player` ( `id` int(16) NOT NULL auto_increment, `first_name` varchar(32) NOT NULL default '', `last_name` varchar(32) NOT NULL default '',

Re: ORDER BY for ints

2005-09-27 Thread Edward Vermillion
Michael Stassen wrote: Stephen A. Cochran Lists wrote: On Sep 27, 2005, at 3:29 AM, Jasper Bryant-Greene wrote: mysql SHOW CREATE TABLE Player| | Player | CREATE TABLE `Player` ( `id` int(16) NOT NULL auto_increment, `first_name` varchar(32) NOT NULL default '', `last_name`

Re: ORDER BY for ints

2005-09-27 Thread Stephen A. Cochran Lists
On Sep 27, 2005, at 9:56 AM, Edward Vermillion wrote: Michael Stassen wrote: Stephen A. Cochran Lists wrote: On Sep 27, 2005, at 3:29 AM, Jasper Bryant-Greene wrote: mysql SHOW CREATE TABLE Player| | Player | CREATE TABLE `Player` ( `id` int(16) NOT NULL auto_increment,

Re: ORDER BY for ints

2005-09-27 Thread Pooly
Hi, The command in PHP is: $query=SELECT id,first_name,last_name FROM Player ORDER BY id; $players=mysql_query($query); When issued from the mysql prompt, order is fine, but when called from php I'm getting that strange order: 1, 10, 11, 12, etc... Steve Cochran Then

Re: ORDER BY for ints

2005-09-27 Thread Stephen A. Cochran Lists
On Sep 27, 2005, at 10:28 AM, Pooly wrote: The command in PHP is: $query=SELECT id,first_name,last_name FROM Player ORDER BY id; $players=mysql_query($query); When issued from the mysql prompt, order is fine, but when called from php I'm getting that strange order: 1, 10, 11, 12, etc...