Jump to content

Don't know what I'm looking for


barrowvian

Recommended Posts

I'm pretty new to mysql so couldn't even tell you the exact name of the problem I'm having  :P

 

Basically, I have a simple database with 3 fields; name, county and decision.

 

What I'm wanting to do is select the data from the database and list it in alphabetical order;

$sql = "SELECT * FROM names ORDER BY name ASC LIMIT $offset, $rowsperpage";

 

Once this is done I want to output the results depending on the 'decision field'. If the decision field = yes then I want the output result to be shown in green. If it = no then output it in red. But I still want to maintain the alpha order.

 

Is this possible and how would I achieve this? thanks

Link to comment
https://forums.phpfreaks.com/topic/205334-dont-know-what-im-looking-for/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.