0
SHOW TABLE STATUS LIKE 'promo_deliveries'

Is there any way other than executing the query with the following

$connection = Yii::$app->getDb();
$command = $connection->createCommand("SHOW TABLE STATUS LIKE 'promo_deliveries'");
$command->queryAll();

using ActiveRecord models in yii2

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68
  • 1
    You have to provide more information, like what is your RDBMS, what will you achieve and what have you tried? [ActiveRecord](http://www.yiiframework.com/doc-2.0/guide-db-active-record.html) is well documented. – R13e Jan 04 '17 at 10:38
  • 1
    As far as I know `SHOW TABLE STATUS` works on "tables" (not the record/data of table) information, whereas `ActiveRecord` works/operates on single table and its record/data – leninhasda Jan 04 '17 at 19:23
  • yes, exactly you are right @leninhasda and i actually want to check the next upcomming autoincrement key for the table promo_deliveries by running this query, that would be available in the `Auto_increment` column – Muhammad Omer Aslam Jan 05 '17 at 09:20
  • possible duplicate of - http://stackoverflow.com/questions/6761403/how-to-get-the-next-auto-increment-id-in-mysql – leninhasda Jan 05 '17 at 18:31

1 Answers1

0

I have to use LAST_INSERT_ID() or mysql_insert_id() not any other way to do it so far.

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68