PHP/ MySQL Array problem.

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

Post Reply
fried
Forum Newbie
Posts: 16
Joined: Tue Sep 08, 2009 5:43 am

PHP/ MySQL Array problem.

Post by fried »

So, I have a database with one table called 'colours' there are three colurs red, green and blue. each also has an id number 1,2 and 3.

Now I want to assign these as page links which is easy enough, but I want to make the first row (red in this case) the default, so it prints a big 'red' on the screen and then turns the next rows into links (not including the 'red').

Is there a specific function that I can use to assign an action to just one specific row. I can't use the id because at some point I might need to delete 'red' and let it default to 'green'

I'll also at some point need to select the 'green' link and create links for the colours in the database that are not green.

What is the best way to approach this problem?

Thanks in advance.
cokeetang
Forum Newbie
Posts: 3
Joined: Mon Oct 12, 2009 1:24 pm

Re: PHP/ MySQL Array problem.

Post by cokeetang »

another field to define that it's the default.
fried
Forum Newbie
Posts: 16
Joined: Tue Sep 08, 2009 5:43 am

Re: PHP/ MySQL Array problem.

Post by fried »

Thanks, that seems like a good way to start.
Post Reply