Jump to content

Recommended Posts

oopss sorry!!! i just dont want to have my typing more complicated any way it will aslo work but

your right all caps is the right way and i also dont use small caps that is hard to debug if complicated query is being debug.

 

also ASC is not default its default in the initial php setup, but to say its default is a misinterpretation of the open sourceness of php. Not to be busting your chops, but if you gonna shot someone down do it right :)

 

what do you mean ^^^

 

when you type order by in mysql it is ordering ascending then???

Link to comment
https://forums.phpfreaks.com/topic/56144-order-by/#findComment-277335
Share on other sites

sort() is a function for arrays already defined ORDER BY is a flag for a MySQL query of the SELECT type.  yes you can sort your results post gathering from MySQL however it becomes a bigger challenge than doing it in query.  This is because you are gathering 0->n rows where n is an integer values equal to the number of results matching the WHERE criteria of the query.  In essence you develop a pseudo dual-deminsonal array which becomes a pain to sort because it doesn't have the proprietary key set to which MySQL field you would like thus making sort a big function that is not needed if you sort in query.

Link to comment
https://forums.phpfreaks.com/topic/56144-order-by/#findComment-277339
Share on other sites

How do I sort a list alphabetically?

I am confused with your Question.

Do you wanna sort an array Alphabatically ??

Use sort() to do that.

I meant.

I didn't understand wheather he was trying to sort an Array or MySQL results.

as his Subject focuses on MySQL and his posts Focuses on Array Sortings.

Why unidox is not repling ??

Link to comment
https://forums.phpfreaks.com/topic/56144-order-by/#findComment-277345
Share on other sites

not trying to brag/nag on you, but php is open source someone out there can mod up php and make their own php 6 if they wanted.  Every part of php can be redefined by you the programmer and for big uses and code optimization you can set stuff like default ORDER BY or default sort() stuff like that. There are some practical uses like if you are always sorting by DESC then you can set DESC as default for that 5 byte code optimization

Link to comment
https://forums.phpfreaks.com/topic/56144-order-by/#findComment-277347
Share on other sites

cooldude832 looks like where at the wrong way you were talking about array and i talk about sql

in just thought it is my sql for seing those key word like you said ORDER BY need to be caps so i think thats sql any way am i wrong for saying that default is ascending in order by clause ?????

YYYY?????

Link to comment
https://forums.phpfreaks.com/topic/56144-order-by/#findComment-277355
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.