i have this php script that gets run by a cronjob everyday:
mysql_connect("$host", "$username", "$password")or die("Could not connect to the database: " . mysql_error()) ;
mysql_select_db("$db_name") or die("Could not select database: " . mysql_error()) ;
//create backup table with current date concatenated to the table name
$create_table = "set @c=concat('create table rc_profile_table_backup_',date_format(now(),'%Y_%m_%d'))";
$prepare = "prepare stmt from @c";
$execute = "execute stmt";
$deallocate = "deallocate prepare stmt";
mysql_query($create_table);
mysql_query($prepare);
mysql_query($execute);
mysql_query($deallocate);
echo $sql11 = "insert rc_profile_table_backup_".mktime(date("y"),date("m"),date("d"))."select * from rc_profile_table"."
";
how can i achieve the insert above? I run this script in a cronjob so it must pick up the the table name with the current date and do the insert. how am i going to know the current date?
thanks