Hi, still fumbling. I have records in a database with an expiration field in DATE format.
I want to display messages according to how long to expiration. please, someone, check my
code. thanks.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "homedb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error)
{ die("Connection failed: " . $conn->connect_error); }
$id=$row['id'];
$password=$row['password'];
$expiredate=$row['expiredate'];
while($row=mysql_fetch_array($result))
{
if(expiredate == expiredate - 7)
echo "<br/>1 week remaining"; }
else (expiredate == expiredate - 1)
{ echo "<br/>1 week remaining"; }
else (expiredate == today());
{ echo "<br/>we're sorry, your contract has expired"; }
?>
I want to display messages according to how long to expiration. please, someone, check my
code. thanks.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "homedb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error)
{ die("Connection failed: " . $conn->connect_error); }
$id=$row['id'];
$password=$row['password'];
$expiredate=$row['expiredate'];
while($row=mysql_fetch_array($result))
{
if(expiredate == expiredate - 7)
echo "<br/>1 week remaining"; }
else (expiredate == expiredate - 1)
{ echo "<br/>1 week remaining"; }
else (expiredate == today());
{ echo "<br/>we're sorry, your contract has expired"; }
?>