I'm trying to grab the table names from my sql file for an upgrade script but I have something incorrect.
Lines in my SQL file that have the names are the CREATE TABLE lines:
CREATE TABLE IF NOT EXISTS `ocx_category` (
In the preg_match_all
statement I'm using this regex:
preg_match_all('#create\s*table\s*`(\w[\w\d]*)`#i', $sql, $table);
But all $table
ends up with:
array (size=2)
0 =>
array (size=0)
empty
1 =>
array (size=0)
empty
Where did I get it wrong?