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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
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.