How to create a SQL table using php IF date is equal to X -


i'm trying create mysql table using php if statement. able create table using if statement; although problem running table gets created when date >= x, opposed how specify statement; if date == x.

how can automatically create sql table if date == x, and, there way create table without having go page table data displayed , refresh page?

here code:

$timezone       = date_default_timezone_set('america/chicago'); $thedate        = time("f j, g:i a");  $servername = "server"; $username = "user"; $password = "pass"; $dbname = "db"; $conn = mysqli_connect('server', 'user', 'pass'); (!$conn->set_charset("utf-8"));  if (!$conn) {     die("connection failed: " . mysqli_error()); } mysqli_select_db($conn, $dbname);  if ($thedate == strtotime("april 24, 9:53 pm")) {  $createtable = "create table issue11 ( id int(5) unsigned auto_increment primary key, first varchar(40) not null, last varchar(40) not null, title varchar(50) not null, storylink varchar(140) not null, genre varchar(11) not null, varchar(2000) not null, link varchar(125) not null, picture varchar(500) not null, alt varchar(100) not null )";   mysqli_query($conn, $createtable); mysqli_close($conn); } 

actually there no problem above code ,
main problem

the code in if condition work if run page at
"april 24, 9:53 pm" (the date specified equality).how can , mean time changing , can't checking each time when time changes using php alone.


idea using ajax call
using ajax
1 way make ajax request run above code each second , , not effective , efficient way do.
way checking @ client side , operation (create table) when if returns true using ajax call page wrote above code.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -