# Creating new table in databse everyday

**URL:** <https://forum.kirupa.com/t/creating-new-table-in-databse-everyday/209796>\
**Category:** programming\
**Created:** [December 12, 2006, 2:42pm UTC](https://forum.kirupa.com/t/creating-new-table-in-databse-everyday/209796 "2006-12-12T14:42:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![feilhk](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@feilhk](https://forum.kirupa.com/u/feilhk)\
**Post date:** [December 12, 2006, 2:42pm UTC](https://forum.kirupa.com/t/creating-new-table-in-databse-everyday/209796/1 "2006-12-12T14:42:20Z")

</div>

Hello, i am working a flash project on attendance , when i submit the attendance, i want to create a new table for everyday.  
the table should be based on the module course and the date  
But i got problem of it, it doesnt create new table when i submit the attendance. Coudl somebody help me?/ thz

i declare  
//today’s date  
$date=date(“d”."/".“m”.",".“y”);  
//the new table, is it correct??  
$newtable=$\_POST[‘moduleName’].$\_POST[‘courseName’].$date;  
There is part of the program

```php

//today's date 
$date=date("d"."/"."m".","."y");
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["RC_insert"])) && ($_POST["RC_insert"] == "form1")) {
//the new table, is it correct??
$newtable=$_POST['moduleName'].$_POST['courseName'].$date;
  $createSQL = sprintf("Create TABLE $newtable (studentNO varchar(9),time varchar(40),moduleName varchar(255),courseName varchar(255));");
  $insertSQL = sprintf("INSERT INTO record (studentNO, time, moduleName, courseName) VALUES (%s, %s, %s, %s)",
            GetSQLValueString($_POST['studentNO'], "text"),
            GetSQLValueString($_POST['Time'], "text"),
   GetSQLValueString($_POST['moduleName'], "text"),
   GetSQLValueString($_POST['courseName'], "text"));
  mysql_select_db($database_flash_agent, $flash_agent);
  $Result1 = mysql_query($createSQL, $flash_agent) or die(mysql_error());
  $Result1 = mysql_query($insertSQL, $flash_agent) or die(mysql_error());
}

```
