Hi, I'm having trouble coding the if/else statement. No matter what value the expiry has, line 17 is
echoed. If it is =>1 I want to sysnav.html.
<?php
$link = mysqli_connect("localhost", "root", "", "homedb");
// Check connection
if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }
//MySqli Select Query
//$results = $mysqli->query ("SELECT * FROM ctltbl");
$id='id';
$expiry='expiry';
$sql = "UPDATE ctltbl
SET $expiry = expiry - 1 where id=$id";
if(mysqli_query($link, $sql)){ echo "."; }
else { echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
if($expiry==0) { echo "We're sorry but your contract has expired. Contact us immediately at propzmgmt@gmail.com"; }
else { header("location:sysnav.html"); } // line 18
?>