Forum Moderators: coopster
preg_match_all("/[0-9a-zA-Z]+[0-9a-zA-Z]+[0-9a-zA-Z]+[0-9a-zA-Z\s]*:/", $input, $output);
$result = $output[0];
// output
// connect to database
$connection = mysql_connect('127.0.0.1', 'root', '') or die('Connection Error:'.mysql_error());
mysql_select_db('things', $connection) or die('Database Error:'.mysql_error());
foreach($result as $a) {
//Pop an echo on the front so that you can see what the loop is producing too, this is good to see
echo $sql = "CREATE TABLE `".$a."`
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// run the first query to clear table
mysql_query($sql, $connection) or die("Query Error:".mysql_error());
}//end loop