Hi all,
I need to find out if a table exists before I create it or perform an insert.
I have spent the last few hours trying to fing a solution, read many posts but fail to get anything to work.
This is what I have so far:
function mysql_table_exists($TableQ){
$exists = mysql_query("SELECT 1 FROM ".$TableQ." LIMIT 0");
if ($exists) return true;
else
return false;
}
if (!mysql_table_exists($TableQ)) {
// create tyable
} else {
// perform insert
}
Am I doing this right or should I be looking at another way to get it working.
Many thanks in advance.