$ Sql1selectcount (*) ascfromzhibanwheredate {$ time}; $ d_objYii: app ()-db-createCommand ($ sql1); $ info $ d_obj-queryAll (); 1. write SQL language 2. use the yii app () instance call method to execute SQL to get a result object 3. use the querryAll method to obtain the result set in the array format
$ Sql1 = select count (*) as c from zhiban where date = '{$ time}'; $ d_obj = Yii: app ()-db-createCommand ($ sql1 ); $ info = $ d_obj-queryAll (); 1. write SQL language 2. use the yii app () instance call method to execute SQL to get a result object 3. use the querryAll method to obtain the result set in the array format
$ Sql1 = "select count (*) as c from zhiban where date = '{$ time }'";
$ D_obj = Yii: app ()-> db-> createCommand ($ sql1 );
$ Info = $ d_obj-> queryAll ();
1. Write SQL language
2. Run the SQL statement to obtain a result object through the method called by the app () instance of yii.
3. Use the querryAll method to obtain the result set in the array format.