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-Johnston
Cc: PHP-General
Subject: Re: [PHP] order by ASC
John Taylor-Johnston
Cc: 'PHP-General'
Subject: RE: [PHP] order by ASC
On Tue, 2010-01-19 at 16:16 -0800, Daevid Vincent wrote:
http://www.webdeveloper.com/forum/showthread.php?t=101174
You could do it like this too...
ORDER BY `rollnumber` + 0 ASC
And if you just got the data out in mysql (no ORDER
...@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:
http://www.webdeveloper.com/forum/showthread.php?t=101174
You could do it like this too
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
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
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
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
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
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
[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
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 the
[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 first
2009/6/11 PJ 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 using mysql, the order is governed by the collation
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 in your
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 your
database?
Robin Vickery wrote:
2009/6/11 PJ af.gour...@videotron.ca 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.
On Thu, Jun 11, 2009 at 11:27 AM, PJaf.gour...@videotron.ca wrote:
Robin Vickery wrote:
2009/6/11 PJ af.gour...@videotron.ca 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
Robin Vickery wrote:
2009/6/11 PJ af.gour...@videotron.ca 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.
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 Eacute; 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
On Thu, Jun 11, 2009 at 11:35 AM, PJ af.gour...@videotron.ca wrote:
Robin Vickery wrote:
2009/6/11 PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca
How can order by be forced to order alphabetically and ignore accents
without stripping the accents for printout? This
2009/6/11 PJ af.gour...@videotron.ca
Robin Vickery wrote:
2009/6/11 PJ af.gour...@videotron.ca 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
opendir/readdir does not promise to deliver the files in any
particular order, no matter what it seems to do on any given day...
Put them in an array and sort() if it's a small list of files.
Or use exec and ls -als or somesuch for a large list of files.
Or...
glob *might* be documented to do
Hi, thanks for all your help today.
I have the following code and I am trying to order the output. Currently it
seems really random. Can anyone point me in the right direction?
?php
$dir = content/current/breaking_news/;
// set pattern
$pattern = .txt*|.TXT*;
// open directory and parse file
Pastor Steve wrote:
Hi, thanks for all your help today.
I have the following code and I am trying to order the output. Currently it
seems really random. Can anyone point me in the right direction?
?php
$dir = content/current/breaking_news/;
// set pattern
$pattern = .txt*|.TXT*;
// open
i hooked up an spl example; and the files are sorted by name.
also, did you want that p inside or outside the span w/
class=NormalText, because the opening and closing tags are
mixed up..
?php
class FileIterator extends FilterIterator {
public function __construct(Iterator $it) {
On Fri, Feb 8, 2008 at 9:19 PM, Nathan Nobbe [EMAIL PROTECTED] wrote:
i hooked up an spl example; and the files are sorted by name.
also, did you want that p inside or outside the span w/
class=NormalText, because the opening and closing tags are
mixed up..
damnit; i had a couple of
On Fri, 2008-02-08 at 21:19 -0500, Nathan Nobbe wrote:
i hooked up an spl example; and the files are sorted by name.
also, did you want that p inside or outside the span w/
class=NormalText, because the opening and closing tags are
mixed up..
Here is another, generic extension filter with
At 10:01 PM +0200 7/11/06, Jochem Maas wrote:
Anyway I can do that?
as many as there ways to skin a cat probably :-)
Yeah, but the cat ain't going to like any of them -- Jeff Foxworthy :-)
tedd
--
I have an array that i would like to sort and reorder based on a simple
critera. I already order the data but I would like to break the data now
into sections by customer id, so one customer has 5 things and another
customer has one. How can I do that with an array.
$data =
Ok I understand your method now. your code does not match your output. how
would your print line produce that , $customerid ?
anyways...
$data = orders($id,$status);
$c = count($data);
$currentId;
$n = 1;
for($i=0; $i$c; $i++) {
$orderid = $data[$i]['orderid'];
$customerid =
Dallas Cahker wrote:
I have an array that i would like to sort and reorder based on a simple
critera. I already order the data but I would like to break the data now
into sections by customer id, so one customer has 5 things and another
customer has one. How can I do that with an array.
On Wed, June 14, 2006 3:23 pm, blackwater dev wrote:
If I have a file:
/code/folder1/test.php
and in that file, it has these includes:
include_once(../../file1.php);
include_once(../../file2.php);
include_once(../../file3.php);
../ is just gonna give you headaches, sooner or later.
Just
If I have a file:
/code/folder1/test.php
and in that file, it has these includes:
include_once(../../file1.php);
include_once(../../file2.php);
include_once(../../file3.php);
I then have another file:
/code/test2.php
That file pulls in test.php.
include_once(folder1/test.php);
Why do I
[snip]
Why do I get errors on the includes?
[/snip]
Includes are included in the order of their inclusion. If an include
includes a child function (such as a class declaration) its parent must
be included first.
What error did you get? My bet is it is a path issue.
--
PHP General Mailing List
On Thu, June 8, 2006 9:59 am, Ben Liu wrote:
I'm using a form (method=POST) to collect 30 boolean values from the
end user using a series of checkboxes in the form. The form is
arranged in a table so that the 30 check boxes are not a long list but
rather three columns (with related items
Hello All,
I'm using a form (method=POST) to collect 30 boolean values from the
end user using a series of checkboxes in the form. The form is
arranged in a table so that the 30 check boxes are not a long list but
rather three columns (with related items columnized). The problem is
when I
On 08/06/06, Ben Liu [EMAIL PROTECTED] wrote:
Hello All,
I'm using a form (method=POST) to collect 30 boolean values from the
end user using a series of checkboxes in the form. The form is
arranged in a table so that the 30 check boxes are not a long list but
rather three columns (with related
Hi Dave,
No, that is definitely a possibility. Right now I am using a foreach
loop to iterate over the $_POST array and determine if each checkbox
is checked or not, if it is checked, than a related piece of data is
written into the text file. This makes for pretty compact code. I
could as you
Ben Liu wrote:
Hi Dave,
No, that is definitely a possibility. Right now I am using a foreach
loop to iterate over the $_POST array and determine if each checkbox
is checked or not, if it is checked, than a related piece of data is
written into the text file. This makes for pretty compact code.
Der...of course. Thanks Ron! I knew the answer was simple. :-)
-Ben
On 6/8/06, Ron Clark [EMAIL PROTECTED] wrote:
why not create an array with the keys in the order you want ( $array=
array(value1,value2,). Then loop through the array and use the
values as keys to the $_POST variable and
I'm trying to use the EXIF extension (PHP 5, Windows
XP). Order didn't seem to matter before (PHP 4). But
now, if my php.ini is like:
extension=php_exif.dll
extension=php_mbstring.dll
PHP gives an unable to load module error. But if I
put the mbstring extension before exif in php.ini, it
works.
You have the correct order. Exif relies on functionality provided by
mbstring.dll, therefore it must be loaded after it.
-Original Message-
I'm trying to use the EXIF extension (PHP 5, Windows
XP). Order didn't seem to matter before (PHP 4). But
now, if my php.ini is like:
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 error:
- 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 by id asc);
But it will create the error
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 title
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 = $id
- 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(select title, information from spec where
product=.$id
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]
To: [EMAIL PROTECTED
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
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
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
--
PHP
... 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:
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:
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...
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 List
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
Payne mailto:[EMAIL PROTECTED]
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 your Outlook
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
Use usort
Mako Shark wrote:
I don't think a simple sort() will do this. Is there a
way I can sort these following array values so that
all will be in numerical order, and then alphabetical
after that?
I need
Dirfiles/97
Dirfiles/98
Dirfiles/99
Dirfiles/100
Dirfiles/101
Dirfiles/102
I don't think a simple sort() will do this. Is there a
way I can sort these following array values so that
all will be in numerical order, and then alphabetical
after that?
I need
Dirfiles/97
Dirfiles/98
Dirfiles/99
Dirfiles/100
Dirfiles/101
Dirfiles/102
Dirfiles/ABG1
Dirfiles/ABG2
in that
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
A quick question about evaluation:
I have the following line in the middle of a large if/elseif/else
statement:
elseif (!empty($_POST['newpassword'])
!$user-set_password($_POST['newpassword']))
I am simply wondering whether or not the set_password() method will be
processed if the first
Yo Erik:
On Tue, Apr 09, 2002 at 11:39:31AM -0400, Erik Price wrote:
elseif (!empty($_POST['newpassword'])
!$user-set_password($_POST['newpassword']))
Your order of evaluation is correct. But, considering the password
length is evaluated in the set_password() function, checking empty()
On Tuesday, April 9, 2002, at 12:24 PM, Analysis Solutions wrote:
Yo Erik:
On Tue, Apr 09, 2002 at 11:39:31AM -0400, Erik Price wrote:
elseif (!empty($_POST['newpassword'])
!$user-set_password($_POST['newpassword']))
Your order of evaluation is correct. But, considering the password
Hey I'm sorry Dan and everyone, I realize my mistake -- if you're
curious it's in my if/elseif/else chain, I explain the problem below
(scroll down):
Erik
On Tuesday, April 9, 2002, at 03:00 PM, Erik Price wrote:
Hm. I threw in a test echo statement in the class method, to make sure
This has nothing to do with PHP.
Find a good HTML reference page on the net and look up input and
TABINDEX
http://www.idocs.com/tags/forms/_INPUT_TABINDEX.html
[EMAIL PROTECTED] wrote:
I have a web page that is generated by a php script and on this page
there are several html text entry slots
I have a web page that is generated by a php script and on this page
there are several html text entry slots such as
echo bSpecial Notes:/binput name=\specialNotes\
size=\65\$prodNotes;
on one page. I fill in several of these input slots with default
values, but there are about 3-4 that require
On Fri, 14 Sep 2001 14:53, Andrew V. Romero wrote:
I have a web page that is generated by a php script and on this page
there are several html text entry slots such as
echo bSpecial Notes:/binput name=\specialNotes\
size=\65\$prodNotes;
on one page. I fill in several of these input slots
On 14-Sep-2001 Andrew V. Romero wrote:
I have a web page that is generated by a php script and on this page
there are several html text entry slots such as
echo bSpecial Notes:/binput name=\specialNotes\
size=\65\$prodNotes;
on one page. I fill in several of these input slots with default
My seem stupid to some, but when running
update tablename set x='$x', y='$y', z='$z' where a=$a;
Does it matter if it the set were in backwards order ie z, y, x ??
Just curious, Im having a problem and I dont know if its because of the
order
Thanks
--
PHP General Mailing List
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
[EMAIL PROTECTED]
-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 3:00 PM
To: PHP
Subject:[PHP] order of update??
My seem stupid to some, but when running
update
Hello Guys,
i'm with problems
first i try to add a value like 8.55 into my sql data base that was set
up to DOUBLE (10,0) and isn't work... i don't know how this work... but i'm
here to ask for someone explain me.
well... i did with varchar to add this value as i want to..
do i have a
Rafael,
Couple of things ... see below. I'm doing this without checking the MySQL
docs, so validate this against them.
At 08:22 PM 5/15/01 -0300, Rafael Faria wrote:
Hello Guys,
i'm with problems
first i try to add a value like 8.55 into my sql data base that was set
up to DOUBLE (10,0)
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:
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
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
76 matches
Mail list logo