sql problem.. i think..

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
khuti
Forum Newbie
Posts: 13
Joined: Mon Mar 06, 2006 12:29 am

sql problem.. i think..

Post by khuti »

hi, im having a spot of bother i think its a sql problem but it mite b my database setup.

basically i have a dynamic list of images table which changes as they delete the images or add them.
i want the list to display in an order so that all the images related to a certain page will be together in a group.

as the images all have there own different id as to when it is added i thought i cant use that as a way to keep them in order so, depending which page they are adding the image for it adds a number 1,2,3,4,5,6,7 or 8 in a field called order so i thought i could do this:

mysql_query("SELECT * FROM pics ORDER BY order ASC");

but it does not work, anybody know why this is? or how i could do it?

id like it to list them so if order = 1

img1
img2

then if order = 2..

img5
img3

then if order = 3

img6
img4

i think u get the jist. not sure the best way to explain myself! anyway thanks for any help in advance..

khuti
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

code? error output? bacon?

Check the output of mysql_error() I have a sneaking suspicion you need to backtick "pics" and "order"
khuti
Forum Newbie
Posts: 13
Joined: Mon Mar 06, 2006 12:29 am

Post by khuti »

hey thanks.. yea i dint realise that was a thing coz sum things work without. now i know its important ta, works fine now :)
Post Reply