Onloac Posted July 29, 2010 Share Posted July 29, 2010 I haven't coded in PHP for a while and I'm trying to refresh my memory on some things. =( I was hoping someone here could help me with a problem. I have a script I made to post articles to my database, one of the columns includes a number. 1 (yes) and 0 (no). Now i'm using this to keep track of what articles have been approved. When I edit an article I want to include a check box. If my database field contains 1 its checked... if its 0 then its not checked. how would I go about doing that? Quote Link to comment https://forums.phpfreaks.com/topic/209204-check-box-results/ Share on other sites More sharing options...
dreamwest Posted July 29, 2010 Share Posted July 29, 2010 <?php //select query //assign data $check = $row['check']; ?> <input type='checkbox' name='fin' <?php if($check == 1){echo 'checked';}?> > Checkbox Quote Link to comment https://forums.phpfreaks.com/topic/209204-check-box-results/#findComment-1092501 Share on other sites More sharing options...
Onloac Posted July 29, 2010 Author Share Posted July 29, 2010 Thanks that worked great! one more quick question! I have a categories listed from my database on a page with a form to edit them. the problem i'm having is when i edit them, the changes dont take place until i refresh the page. I had it working before so I would see the changes without refreshing but I lost my old code. =( any idea what I have to. I think it was something about database queries. I can't remember though. =( Quote Link to comment https://forums.phpfreaks.com/topic/209204-check-box-results/#findComment-1092505 Share on other sites More sharing options...
dreamwest Posted July 29, 2010 Share Posted July 29, 2010 http://www.wizecho.com/nav=scripts&s=ajax_form Quote Link to comment https://forums.phpfreaks.com/topic/209204-check-box-results/#findComment-1092512 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.