php - mysql query yii not getting value -


Do I have any queries that come with a query?

  Public Resolve () ($ Resul = Yii :: app () -> gtc- gt; createCommand () - & gt; select ('maximize') ('Yii_availability') -> Execute (); $ found = mysql_query ($ result); $ Res = $ got ['max'] + 1; $ Rs = 'SA '$ Race. Return "{$ rs}";}  

It always returns SA1 , but I have to get the last ID plus plus 1 In this case, I have the next autoincremental ID from my id column.

For example: I have field with SA0000005 Creating a new registry

Thanks for your help
  $ resul = Yii :: app () -> gt; db-> createCommand () - & gt; Select ('maximize') -> from ('yii_availability') -> execute (); $ found = mysql_query ($ Result); // What are you doing here  

In addition to the typo, this is not how a query builder should be used. Have you read?

The probable reason is that why you always get SA1, because $ meets ['max' (id) '] is the expression tap you add 1 on it. You want something

// Returns the wrong result on non-conformity, maximum ('id') otherwise Yii :: app () -> gt; Db- & gt; Createcommand () - & gt; Select ('maximize') - & gt; ('Yii_availability') - & gt; QueryScalar ();

Comments