moto51 Posted September 24, 2011 Share Posted September 24, 2011 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 More sharing options...
Buddski Posted September 24, 2011 Share Posted September 24, 2011 Is the data in your table stored anywhere or is it hard coded html? Link to comment https://forums.phpfreaks.com/topic/247761-simple-active-inactive-icon/#findComment-1272287 Share on other sites More sharing options...
moto51 Posted September 24, 2011 Author Share Posted September 24, 2011 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 https://forums.phpfreaks.com/topic/247761-simple-active-inactive-icon/#findComment-1272288 Share on other sites More sharing options...
Buddski Posted September 24, 2011 Share Posted September 24, 2011 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 https://forums.phpfreaks.com/topic/247761-simple-active-inactive-icon/#findComment-1272290 Share on other sites More sharing options...
moto51 Posted September 24, 2011 Author Share Posted September 24, 2011 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 https://forums.phpfreaks.com/topic/247761-simple-active-inactive-icon/#findComment-1272291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.