bourgm Posted August 22, 2009 Share Posted August 22, 2009 Is there a way to make a url that changes a field from 1 to 0? I have a "ID" field and a "print_status" field. something like ?rid=<?php echo $row['id'];]; then the something to modify "print_status" to =0. I am not good a php as you can tell. lol. I usually just modify till I get it to do what I want. Learning as I go. Quote Link to comment https://forums.phpfreaks.com/topic/171434-simple-modification-of-one-field-in-a-table/ Share on other sites More sharing options...
xangelo Posted August 22, 2009 Share Posted August 22, 2009 I'm not quite sure what you mean, but you can pass additional variables through the url so that it looks like this: index.php?rid=5&print_status=0 And you can get those values like this: <?php $rid = $_GET['rid']; $print_status = $_GET['print_status']; ?> Don't forget to sanitize your input though. Quote Link to comment https://forums.phpfreaks.com/topic/171434-simple-modification-of-one-field-in-a-table/#findComment-904110 Share on other sites More sharing options...
ignace Posted August 22, 2009 Share Posted August 22, 2009 $row['print_status'] ? 0 : 1; returns 0 if print_status contains 1 and vice versa Quote Link to comment https://forums.phpfreaks.com/topic/171434-simple-modification-of-one-field-in-a-table/#findComment-904115 Share on other sites More sharing options...
bourgm Posted August 23, 2009 Author Share Posted August 23, 2009 I'm not quite sure what you mean, but you can pass additional variables through the url so that it looks like this: index.php?rid=5&print_status=0 And you can get those values like this: <?php $rid = $_GET['rid']; $print_status = $_GET['print_status']; ?> Don't forget to sanitize your input though. So if I make say a index.php file and do index.php?rid=5&print_status=0 I understand your code where you GET the code from the url, but what do you use to make the modify to change print_status=0 Quote Link to comment https://forums.phpfreaks.com/topic/171434-simple-modification-of-one-field-in-a-table/#findComment-904268 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.