RE: [PHP] order by ASC

2010-01-19 Thread Ashley Sheridan
; 1001 > >>> 998 > >>> 999 > >>> > >>> I want it to order like this: > >>> > >>> 998 > >>> 999 > >>> 1000 > >>> 1001 > > > _ > > From: Ashley Sheridan [mailto:a..

RE: [PHP] order by ASC

2010-01-19 Thread Daevid Vincent
gt;>> 999 >>> 1000 >>> 1001 _ From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Tuesday, January 19, 2010 4:40 PM To: Daevid Vincent Cc: 'PHP-General' Subject: RE: [PHP] order by ASC On Tue, 2010-01-19 at 16:16 -0800, Daevid Vincent wrote:

RE: [PHP] order by ASC

2010-01-19 Thread Ashley Sheridan
gt; in mysql), you could use PHP's sort as well... > > http://php.net/manual/en/function.natsort.php > > > -Original Message- > > From: Robert Cummings [mailto:rob...@interjinn.com] > > Sent: Saturday, January 16, 2010 9:37 PM > > To: John Taylor-Jo

RE: [PHP] order by ASC

2010-01-19 Thread Daevid Vincent
t.php > -Original Message- > From: Robert Cummings [mailto:rob...@interjinn.com] > Sent: Saturday, January 16, 2010 9:37 PM > To: John Taylor-Johnston > Cc: PHP-General > Subject: Re: [PHP] order by ASC > > John Taylor-Johnston wrote: > > Did some googl

Re: [PHP] order by ASC

2010-01-16 Thread Robert Cummings
John Taylor-Johnston wrote: Did some googling. This worked: ORDER BY CAST(`rollnumber` AS SIGNED) What is the difference? My problem in the meanwhile must be my version of MySQL? You could have skipped quotes altogether. The difference is that you are referencing a field name, not a string v

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
Did some googling. This worked: ORDER BY CAST(`rollnumber` AS SIGNED) What is the difference? My problem in the meanwhile must be my version of MySQL? John Taylor-Johnston wrote: It hates me: SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(rollnumber

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
It hates me: SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(rollnumber AS int) SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(`rollnumber` AS int) SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life

Re: [PHP] order by ASC

2010-01-16 Thread Robert Cummings
John Taylor-Johnston wrote: Ok, I think this is a MySQl question. Take pity on me? $sql = "SELECT * FROM $db.`mailinglist` WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY `rollnumber` ASC"; rollnumber is a varchar(50). I need it to be a text field. ASC does not order the way

[PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
Ok, I think this is a MySQl question. Take pity on me? $sql = "SELECT * FROM $db.`mailinglist` WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY `rollnumber` ASC"; rollnumber is a varchar(50). I need it to be a text field. ASC does not order the way I want. 1000 1001 998 999

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
2009/6/11 PJ > Robin Vickery wrote: > > > > > > 2009/6/11 PJ mailto:af.gour...@videotron.ca>> > > > > How can order by be forced to order alphabetically and ignore accents > > without stripping the accents for printout? This is a problem for > both > > caps & normal letters. > > > > >

Re: [PHP] order by what?

2009-06-11 Thread Eddie Drapkin
On Thu, Jun 11, 2009 at 11:35 AM, PJ wrote: > Robin Vickery wrote: > > > > > > 2009/6/11 PJ mailto:af.gour...@videotron.ca>> > > > > How can order by be forced to order alphabetically and ignore accents > > without stripping the accents for printout? This is a problem for > both > > c

Re: [PHP] order by what?

2009-06-11 Thread Per Jessen
PJ wrote: > PJ wrote: > There are some options which all need some sort of adjustment. > If , e.g. É is used in the db instead of É the output onscreen > is a little black diamond with a quesion mark inside. The order is > correct, but the diamond is not acceptable... obviously, one cannot > expec

Re: [PHP] order by what?

2009-06-11 Thread PJ
Robin Vickery wrote: > > > 2009/6/11 PJ mailto:af.gour...@videotron.ca>> > > How can order by be forced to order alphabetically and ignore accents > without stripping the accents for printout? This is a problem for both > caps & normal letters. > > > Depends on the database. > > If you'

Re: [PHP] order by what?

2009-06-11 Thread Andrew Ballard
On Thu, Jun 11, 2009 at 11:27 AM, PJ wrote: > Robin Vickery wrote: >> >> >> 2009/6/11 PJ mailto:af.gour...@videotron.ca>> >> >>     How can order by be forced to order alphabetically and ignore accents >>     without stripping the accents for printout? This is a problem for both >>     caps & norma

Re: [PHP] order by what?

2009-06-11 Thread PJ
Robin Vickery wrote: > > > 2009/6/11 PJ mailto:af.gour...@videotron.ca>> > > How can order by be forced to order alphabetically and ignore accents > without stripping the accents for printout? This is a problem for both > caps & normal letters. > > > Depends on the database. > > If you'

Re: [PHP] order by what?

2009-06-11 Thread PJ
Jay Blanchard wrote: > [snip] > >> [snip] >> How can order by be forced to order alphabetically and ignore accents >> without stripping the accents for printout? This is a problem for both >> caps & normal letters. >> [/snip] >> >> Definitely an SQL question. What character set are you using in

Re: [PHP] order by what?

2009-06-11 Thread PJ
PJ wrote: > Jay Blanchard wrote: > >> [snip] >> How can order by be forced to order alphabetically and ignore accents >> without stripping the accents for printout? This is a problem for both >> caps & normal letters. >> [/snip] >> >> Definitely an SQL question. What character set are you using

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
2009/6/11 PJ > How can order by be forced to order alphabetically and ignore accents > without stripping the accents for printout? This is a problem for both > caps & normal letters. Depends on the database. If you're using mysql, the order is governed by the collation used. To get the order y

RE: [PHP] order by what?

2009-06-11 Thread Jay Blanchard
[snip] > [snip] > How can order by be forced to order alphabetically and ignore accents > without stripping the accents for printout? This is a problem for both > caps & normal letters. > [/snip] > > Definitely an SQL question. What character set are you using in your > database? Is the accent the

Re: [PHP] order by what?

2009-06-11 Thread PJ
Jay Blanchard wrote: > [snip] > How can order by be forced to order alphabetically and ignore accents > without stripping the accents for printout? This is a problem for both > caps & normal letters. > [/snip] > > Definitely an SQL question. What character set are you using in your > database? Is t

RE: [PHP] order by what?

2009-06-11 Thread Jay Blanchard
[snip] How can order by be forced to order alphabetically and ignore accents without stripping the accents for printout? This is a problem for both caps & normal letters. [/snip] Definitely an SQL question. What character set are you using in your database? Is the accent the first character of the

[PHP] order by what?

2009-06-11 Thread PJ
How can order by be forced to order alphabetically and ignore accents without stripping the accents for printout? This is a problem for both caps & normal letters. -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." - Phil J

RE: [PHP] Order by

2004-08-03 Thread Karl-Heinz Schulz
Thank you for your help! -Original Message- From: Jim Grill [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 10:33 PM To: Karl-Heinz Schulz; [EMAIL PROTECTED] Subject: Re: [PHP] Order by - Original Message - From: "Karl-Heinz Schulz" <[EMAIL PROTECTED]

Re: [PHP] Order by

2004-08-03 Thread Jim Grill
- Original Message - From: "Karl-Heinz Schulz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 03, 2004 9:19 PM Subject: [PHP] Order by > How can I use the "Order" statement for this query? > > $specs_query = mysql_query(&

Re: [PHP] Order by

2004-08-03 Thread Wesley Furgiuele
Looks like you just forgot some quotes: $specs_query = mysql_query( "select title, information from spec where product=".$id." order by id asc" ); Or just move your quotes to the end -- I think you should be fine: $specs_query = mysql_query( "select title, information from spec where product = $

RE: [PHP] Order by

2004-08-03 Thread Karl-Heinz Schulz
Thank you - stupid me -Original Message- From: Wesley Furgiuele [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 10:27 PM To: Karl-Heinz Schulz Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Order by Looks like you just forgot some quotes: $specs_query = mysql_query( "select

Re: [PHP] Order by

2004-08-03 Thread Jake McHenry
- Original Message - From: "Karl-Heinz Schulz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 03, 2004 10:19 PM Subject: [PHP] Order by > $specs_query = mysql_query("select title, information from spec where > product=".$id order

[PHP] Order by

2004-08-03 Thread Karl-Heinz Schulz
How can I use the "Order" statement for this query? $specs_query = mysql_query("select title, information from spec where product=".$id); I tried to use $specs_query = mysql_query("select title, information from spec where product=".$id order by id asc); But it will create the error. Parse e

Re: [PHP] order by

2004-01-27 Thread Brian V Bonini
On Tue, 2004-01-27 at 07:34, christian tischler wrote: > Is there a way wuth php to create a list ordered by more than one column > like in excel or access. > > something like "ORDER BY points AND score" ... ORDER BY column1, column2, etc...; -- BrianGnuPG -> KeyID: 0x04A4F0DC | URL: ww

Re: [PHP] order by

2004-01-27 Thread Marek Kilimajer
... ORDER BY points [DESC|ASC], score [DESC|ASC] christian tischler wrote: Is there a way wuth php to create a list ordered by more than one column like in excel or access. something like "ORDER BY points AND score" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

RE: [PHP] order by

2004-01-27 Thread Thomas Svenson
christian tischler wrote: > Is there a way wuth php to create a list ordered by more than one > column like in excel or access. > > something like "ORDER BY points AND score" You might want to look at GROUP BY command too http://www.mysql.com/doc/en/Group_by_functions_and_modifiers.html /T -- P

Re: [PHP] order by

2004-01-27 Thread Stuart
christian tischler wrote: Is there a way wuth php to create a list ordered by more than one column like in excel or access. something like "ORDER BY points AND score" Use http://php.net/usort and use both 'columns' in the comparison function. -- Stuart -- PHP General Mailing List (http://www.php.n

[PHP] order by

2004-01-27 Thread christian tischler
Is there a way wuth php to create a list ordered by more than one column like in excel or access. something like "ORDER BY points AND score" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Ok, this gives me an error. I guess what I was asking early is there away to print an echo without doing myrow? Why can I do echo $result without getting Resource id # My thinking is if you look at my first e-mail, my code is trying to fetch multi-rows from the database, I don't need multi row,

RE: [PHP] ORDER BY RAND()....

2003-10-29 Thread Chris W. Parker
Payne on Wednesday, October 29, 2003 11:54 AM said: >> Try -> >> SELECT url FROM sponsors ORDER BY RAND() LIMIT 1; >> >> >> > I did that same thing. SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1; How about that one? Chris. -- Don't like reformatting

Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Gerard Samuel wrote: On Wednesday 29 October 2003 02:24 pm, Payne wrote: Hi, I have been working on a simple PHP script that called to a mysql database, where I do the following SELECT url FROM sponsors ORDER BY RAND(); Try -> SELECT url FROM sponsors ORDER BY RAND() LIMIT 1; I di

Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Gerard Samuel
On Wednesday 29 October 2003 02:24 pm, Payne wrote: > Hi, > > I have been working on a simple PHP script that called to a mysql > database, where I do the following > > SELECT url FROM sponsors ORDER BY RAND(); Try -> SELECT url FROM sponsors ORDER BY RAND() LIMIT 1; -- PHP General Mailing

[PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Hi, I have been working on a simple PHP script that called to a mysql database, where I do the following SELECT url FROM sponsors ORDER BY RAND(); When I do a refresh I keep getting the same url, I have test this sql statement in mysql and it works great. I think my problem is this... He

[PHP] ORDER BY from 2 tables

2002-07-29 Thread Georgie Casey
i assume this is a simple question... how can I SELECT * FROM 2 different tables in the same query, ORDER BYing the 'hits' column, which both tables have. eg, 2 tables i have are similiar and i want to merge them and then select everything ordering by hits -- PHP General Mailing List (http:/

Re: [PHP] Order by Date (Newbie)

2001-02-23 Thread Kyndig
On Fri, 23 Feb 2001, Brian S. Drexler wrote: > Ok, I must be missing something, but does anyone have a script that will > order by the closest date in the future that hasn't been here yet. Did that > make sense? > > Brian > $plusten = mktime(0,0,0,date("m"),date("d")+10,date("Y") ); Will take

Re: [PHP] Order by Date (Newbie)

2001-02-23 Thread Joe Stump
To order by dates use SQL select * from news order by PostDate DESC; and then make sure that PostDate is a date or datetime - hell even an int with a unix timestamp (aka time()) will work. --Joe On Fri, Feb 23, 2001 at 07:52:54PM -0500, Brian S. Drexler wrote: > Ok, I must be missing something

[PHP] Order by Date (Newbie)

2001-02-23 Thread Brian S. Drexler
Ok, I must be missing something, but does anyone have a script that will order by the closest date in the future that hasn't been here yet. Did that make sense? Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [