Jump to content

Simple Active Inactive Icon


moto51

Recommended Posts

I've been browsing the foams for a while now but haven't posted until now. Anyway,

 

I have a table containing a list of items, I want a column to have either a red or a green icon depending on the state I set manually. My question is, how would I best set this up? I'd like to be able to have a simple checkbox admin page that when saved the other page reflects the state either 0 (inactive) or 1 (active), what would be the best way of storing these values and then reading them again? By this I mean a text file, MySQL, etc.

 

I have some knowledge of PHP and MySQL, though not a massive amount.

Link to comment
https://forums.phpfreaks.com/topic/247761-simple-active-inactive-icon/
Share on other sites

So far neither, I'd just do HTML but as i'm still learning i'm open to options, and am I correct in thinking I should chuck it in a DB with a column for active/inactive?

 

EDIT: By the way, the table isn't terribly large, max of 15 - 20 items.

If you are always updating the data putting it into a database would be the best way to go..

All you have to do is create your database structure with all the fields in your html table and add an active/inactive column.

 

If your looking for somewhere to start, post the current table (in [ code ] tags) and somebody will be able to assist you :)

Cheers, I think I know what has to be done, now that I know what way I should be doing it. Before I was thinking some form of text file with every status separated by a comma and then reading the text file into an array, and yeah making it terribly complicated.

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.