- Edited
Hi, please tell me why the result
the code:
<?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($link, "SELECT `id`, `expiry` FROM `ctltbl`");
$row = $results->fetch_row();
$id = $row[0];
$expiry = (int) $row[1];
if ($expiry > 0) {
$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);
}
header("location:sysnav.html");
}
echo "We're sorry but your contract has expired. Contact us immediately at uCanLease@yahoo.com";
?>
--------------------------------------------
result;
fetch_row(); $id = $row[0]; $expiry = (int) $row[1]; if ($expiry > 0) {
$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); }
header("location:sysnav.html"); } echo "We're sorry but your contract has expired. Contact us
immediately at uCanLease@yahoo.com"; ?>
[Added [code]...[/code]
tags ~ Moderator]