Hey, I'm working on a College project that means you have to re-do the database each time you work on your assignment. So, what I'm hoping to create is a file called "sql_connect.php" which will check if the table is there, if not.. It will run the function that creates it. Here is my code:
<?php
DEFINE ('DB_USER', 'USERNAME');
DEFINE ('DB_PASSWORD', 'PASSWORD');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'TABLE');
// make the connection
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('');
// select the database
$tbc = @mysql_select_db (DB_NAME) OR die ('fgddffdfdfd');
if(!$tbc)
{
sql_insert();
}else{
}
?>
Thanks for any help :)