Check programmatically if table exists in SQLite
#1

Hi, I know how to create a table if not exists but how can I pre-check programmatically if a table exists?

I'm using like this at the moment:
Код:
CREATE TABLE IF NOT EXISTS `TABLENAME` (`columns`)
which works perfect.
Reply
#2

Solved.

If anyone wants to know:
pawn Код:
if(!db_query(DB: database, "SELECT * FROM `table` LIMIT 1"))
{
        // doesn't exist
}
else
{
        // it does exist
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)