Leo,
$tw1 was define as a partial datestamp which I was using as the table name. Examine the create table line, value $tw1 is assigned there. It resulted in 052101 if used today.
$date = getdate();
$tw1 = $date[month].$date[yday].$date[year];
$found_table = 0;
$dp = mysql_list_tables("database");
$i = 0;
while ($i < mysql_num_rows ($dp)) {
if(mysql_tablename ($dp, $i) == $tw1) {
$found_table = 1;
}
$i++;
}
if($found_table == 0){
mysql_query ("CREATE TABLE $tw1 (id TINYINT (2) not null AUTO_INCREMENT, dpid VARCHAR (50) not null ,
vdpid VARCHAR (50) not null , vote TINYINT (3) not null , PRIMARY KEY (id))");
}