SQL command not working !!

Hello all,

I want to run this sql command "SHOW TABLE STATUS LIKE TableName" to know the value of "Auto_increment".

I used these instructions :




$row = $model->getDbConnection()->createCommand('SHOW TABLE STATUS LIKE TableName')->queryRow();

$nextCmd = $row["Auto_increment"];



CDbException : ‘CDbCommand failed to execute the SQL statement’.

have you any idea ?

Thankyou.

maybe you should put the quote to the TableName become like this


"SHOW TABLE STATUS LIKE 'TableName'"

Thank you junxiong, the inclusion of quote has solved the problem :)