Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.