Search code examples
mysqlormidiorm

Idiorm (MySQL) - Raw query - SHOW TABLES LIKE


I use Idiorm as ORM for MySQL with PHP.

I need to check if a table is created or not.

In SQL

This works in phpMyAdmin

SHOW TABLES LIKE 'ro_globals'

What I tried in Idiorm

ORM::raw_query("SHOW TABLES LIKE 'ro_globals'")->count()

Call to undefined method admin::count()

Is it possible to make this work with Idiorm? If so, how?


Solution

  • I got the answer in a comment by Saharsh. It's not a Idiorm problem, it could be solved with SQL.

    Result

    CREATE TABLE IF NOT EXISTS