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
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Thu Jan 15, 2004 8:27 am
i am doing this :
Code: Select all
SELECT * from clients order by client_name asc
and for some reason i dont get the result sorted!!!!!
why is that?thanks in advance
peleg
Dr Evil
Forum Contributor
Posts: 184 Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland
Post
by Dr Evil » Thu Jan 15, 2004 8:54 am
Are you sure you don't have spaces before some of your names or other hidden characters ?
Dr Evil
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Thu Jan 15, 2004 9:08 am
what data type is the client_name field?
Mark
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 1:27 am
its varcahr(30) and ichecked no spaces!
kettle_drum
DevNet Resident
Posts: 1150 Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England
Post
by kettle_drum » Sun Jan 18, 2004 2:03 am
Everything looks fine unless your mis-spelling the field or table name. Just try playing with it a bit:
SELECT * FROM clients ORDER BY client_name ASC
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 2:06 am
maybe the problem its hebrew letters?
right to left language?
but still strange in other places works just find
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Sun Jan 18, 2004 2:14 am
ASC is the default order anyway, so you don't need to specify it. As a test, if you sort by DESC instead, are the results in a different order than if you omit the order? (just to prove it's at least doing some sort of ordering
)
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 2:19 am
nope it gives not the correct order opposite
but an oposite order to the regular order i recive at the moment
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Sun Jan 18, 2004 2:33 am
Must be down to the hebrew characters then, you could try starting mysql with the --default-character-set=hebrew option to see if it makes any difference, though i'm not sure if that is your default character set or just for this particular instance, but worth a go as a test.
http://www.mysql.com/doc/en/Character_sets.html is worth a read too.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 2:39 am
where execlly do i do :
"default-character-set=hebrew "
in which ini file do i define it?
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Sun Jan 18, 2004 2:40 am
Windows or *nix ?
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 2:48 am
windows
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 2:49 am
by the way how can i check for each table whats it "character-set"
set to?
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Sun Jan 18, 2004 3:06 am
You can put :
set-variable=default-character-set=hebrew
in my.ini (which i think is in c:\windows) then restart mysql.
I'm not sure how (or even if) you can set a character set per table.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Sun Jan 18, 2004 3:14 am
well i did it but no change i still see the default latin1?