Jump to content

Simple modification of one field in a table


bourgm

Recommended Posts

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.

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.

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

Archived

This topic is now archived and is closed to further replies.

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