alphabetize my listings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: alphabetize my listings

Post by jaoudestudios »

Which one?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: alphabetize my listings

Post by jaoudestudios »

Post your database schema
studio29
Forum Newbie
Posts: 12
Joined: Mon Dec 29, 2008 10:37 am

Re: alphabetize my listings

Post by studio29 »

lazy??? i did do a google search before I even came to this forum and tried the code but it is still doing the same thing, thats why i tried a forum instead. I was getting frustrated, this is the reason why I came here.

Not playing any cards here, just looking for help.
studio29
Forum Newbie
Posts: 12
Joined: Mon Dec 29, 2008 10:37 am

Re: alphabetize my listings

Post by studio29 »

ill have the database schema to you in a sec.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: alphabetize my listings

Post by jaoudestudios »

studio29 wrote:i did do a google search before
Did you? Well the example I posted that managed to give you the help you needed was the 1st result from google!

I'm outta here guys, he's all yours!
studio29
Forum Newbie
Posts: 12
Joined: Mon Dec 29, 2008 10:37 am

Re: alphabetize my listings

Post by studio29 »

3;"Alabama";"0"
4;"Alaska";"0"
5;"Arkansas";"0"
6;"Arizona";"0"
8;"Colorado";"0"
9;"Florida";"0"
10;"Georgia";"0"
11;"Iowa";"0"
12;"Illinois";"0"
13;"Indiana";"0"
14;"Kansas";"0"
15;"Kentucky";"0"
16;"Louisiana";"0"
17;"Maryland";"0"
18;"Michigan";"0"
19;"Missouri";"0"
20;"Mississippi";"0"
21;"Montana";"0"
22;"North Carolina";"0"
23;"Nebraska";"0"
24;"New Mexico";"0"
25;"Oklahoma";"0"
26;"South Carolina";"0"
27;"Tennessee";"0"
28;"Texas";"0"
29;"Virginia";"0"
30;"Franklin";"1"
31;"Bedford";"1"
32;"Campbell";"1"
33;"Floyd";"1"
34;"Pittsylvania";"1"
35;"Henry";"1"
36;"Halifax";"1"
37;"Nelson";"1"
38;"Roanoke";"1"
39;"Rocky Mount";"2"
40;"Bedford";"2"
41;"Lynchburg";"2"
42;"Roanoke";"2"
43;"Salem";"2"
44;"Moneta";"2"
45;"Penhook";"2"
46;"Boones Mill";"2"
47;"Blacksburg";"2"
48;"Christiansburg";"2"
49;"Danville";"2"
50;"Martinsville";"2"
51;"Burnt Chimney";"2"
52;"Glade Hill";"2"
53;"Gretna";"2"
54;"Ferrum";"2"
55;"Forest";"2"
56;"Craig";"1"
57;"Montgomery";"1"
58;"Botetourt";"1"
59;"Buchanan";"2"
60;"Calloway";"2"
61;"Altavista";"2"
62;"Blue Ridge";"2"
63;"Troutville";"2"
64;"Fincastle";"2"
65;"Appomattox";"1"
66;"Appomattox";"2"
67;"Giles";"1"
68;"Radford";"2"
69;"Pulaski";"2"
72;"Washington";"0"
73;"Wisconsin";"0"
74;"Wyoming";"0"
75;"Westlake";"2"
79;"Collinsville";"2"
77;"West Lake";"2"
81;"California";"0"


not sure if this is what you want, but the 0 relates to states, 1 and 2 relate to cities and counties. the one that is not alphabetized is california.
studio29
Forum Newbie
Posts: 12
Joined: Mon Dec 29, 2008 10:37 am

Re: alphabetize my listings

Post by studio29 »

ok....i did post my code...i then posted the code that I tried....and now your calling me lazy...how so much for a helpful forum.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: alphabetize my listings

Post by onion2k »

Surely California shouldn't even be in the list ... your query selects all the ones where 'type' is different to 0.
studio29
Forum Newbie
Posts: 12
Joined: Mon Dec 29, 2008 10:37 am

Re: alphabetize my listings

Post by studio29 »

You are right onion, i had two sets of php code, one for the states and one for the cities/towns. I only posted the towns (my mistake).

Even though I felt the penguin man was a bit rude, he still helped fix my problem. I appreciate everyone's help and I am sorry I wasn't alert when following the procedures.

Thank you so much,

DeShea
Post Reply