I have this website where I define an age for a animal to become old. If I define that 6 years is the age of an animal to become old I want to update my table(that as the born date of the animal) and all the animals in that situation become old. I have the Data field in varchar because in Date is was giving me problems.
$variable = $_POST['age']; **Here I am receiving the date I define in previous page**
if($variable == null){
?>
<script>
alert("Please choose an age");
self.location="Definitions.php";
</script>
<?php
}
**I need also to retrieve the actual system date**
if(isset($_POST['submit_x'])) **This is the id from previous page**
{
$query="update animal set old = '1' where chipnumber = {$var} AND user_id = {$_SESSION['user_id']}...."; **I need to complete my query in order to update only in the animals with the age I defined**
mysqli_query($con, $query) or die (mysql_error());