cronThis Posted February 4, 2008 Share Posted February 4, 2008 I'm building a table that someone can come in and review and check off whether something is approved or not. But I need the checkboxes to update the database. The Problem is that I need a way to say "IF the value in the DB of this 'checkbox column' is 0 then update to a 1 else DO THE OPPOSITE" Here's my table thus far... <td><a href="<?php echo $row_all_musicInfo['url']; ?>" target="_blank"><?php echo $row_all_musicInfo['url']; ?></a></td> <td><?php echo $row_all_musicInfo['cat']; ?></td> <td><input name="inProgress" type="checkbox" value="inProgress" disabled="true" <?php if($row_all_musicInfo['inprogress'] == 1){ echo "checked"; }?> /></td> <td><input name="approved" type="checkbox" value="approved" disabled="true" <?php if($row_all_musicInfo['approve'] == 1){ echo "checked"; }?> /></td> <td><input name="recorded" type="checkbox" value="recorded" disabled="true" <?php if($row_all_musicInfo['recorded'] == 1){ echo "checked"; }?> /></td> </tr> Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/89378-update-db-value/ 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.