|
|
#11 |
|
Member
Join Date: Dec 2008
Posts: 34
Rep Power: 3 ![]() |
Here is what I found:
function getStates() { global $db; $sSQL="SELECT name FROM ".PREFIX."states ORDER BY name ASC"; $result=$db->query($sSQL); while($rs=$result->fetch()){ $states[]=$rs; } $result->freeResult(); return $states; } Modified: $sSQL="SELECT name FROM ".PREFIX."ORDER BY abbrev, name ASC"; Is this correct? Thanks!
__________________
Developer v4.0.9 |
|
|
|
|
|
#12 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,618
Rep Power: 47 ![]() ![]() |
That's exactly what you're looking for. Just add the abbrev to the ORDER by like this:
$sSQL="SELECT name FROM ".PREFIX."states ORDER BY abbrev, name ASC"; Always keep a back up! Always comment your modifications, so you know what you did later on! -Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#13 |
|
Member
Join Date: Dec 2008
Posts: 34
Rep Power: 3 ![]() |
I just added Hawaii and it came up 3rd on the list. The code did not change anything. Am I doing something wrong?
__________________
Developer v4.0.9 |
|
|
|
|
|
#14 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,618
Rep Power: 47 ![]() ![]() |
The suggested modification was based on the assumption of what you stated earlier in that you entered "CAN" and "USA" in the abbrev fields for the states. It should work as it is sorting by the abbreviation first then by the name.
-Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#15 |
|
Member
Join Date: Dec 2008
Posts: 34
Rep Power: 3 ![]() |
I added the states abbrev USA and CAN but I does not seem to work.
It still picks up the state name before the abbreviation.
__________________
Developer v4.0.9 |
|
|
|
|
|
#16 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,618
Rep Power: 47 ![]() ![]() |
Hmmm, the only thing I can think is that you may need to also select the abbrev in order to ORDER BY it.
Try this: $sSQL="SELECT name, abbrev FROM ".PREFIX."states ORDER BY abbrev, name ASC"; -Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#17 |
|
Member
Join Date: Dec 2008
Posts: 34
Rep Power: 3 ![]() |
I tried that now, but no luck. Same thing.
Should this reflect in my "/administration/settingsstates.php" admin view?
__________________
Developer v4.0.9 Last edited by cflo; 01-09-2009 at 10:46 PM. |
|
|
|
|
|
#18 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,618
Rep Power: 47 ![]() ![]() |
$sSQL="SELECT name FROM ".PREFIX."states ORDER BY abbrev ASC, name ASC";
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#19 |
|
Member
Join Date: Dec 2008
Posts: 34
Rep Power: 3 ![]() |
That dont work either.
__________________
Developer v4.0.9 |
|
|
|
|
|
#20 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,618
Rep Power: 47 ![]() ![]() |
Well, I don't understand that. Perhaps someone smarter than I can help out. Sorry.
-Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.3) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If I only have 1 country can a user select states? | gstar | Pre Sales Questions | 5 | 09-11-2008 07:51 AM |
| Replace Country name by Country Code | hel68c | Modules / Plugins / Modifications | 7 | 09-10-2008 08:56 PM |
| edit states and country | ymac | v4 Questions & Support | 3 | 02-29-2008 04:04 PM |
| Select Provinces By Country. | pschievink | v3.1 Questions & Support | 0 | 07-06-2007 02:02 PM |
| Multiple provinces | pschievink | v3.1 Questions & Support | 3 | 06-22-2007 09:08 AM |