-2

How to make such as: IF (table if exists types) THEN ... END ?

1 Answers1

0

Try this:

SELECT COUNT(*)
FROM information_schema.tables 
WHERE table_schema = '[database name]' 
AND table_name = '[table name]';

Save the result and you can use it in an if statement

Snipezzzx
  • 26
  • 7