I use Yii to query:

 return Yii::app()->db ->createCommand('SELECT `fio` FROM `users` WHERE `ID` = "12"') ->execute(); 

Instead of the name, it returns the unit, that is, the number of lines. Tried different options - always returns count(fio) .

  • Everything, understood, it was necessary instead of execute() use queryRow() or queryAll() . Thank you all :) - Boeny

2 answers 2

The help on yii says that execute returns the number of results (integer). More details on the link

    You do not execute () need. He just sends the request and that's it.

    Returns only the first row of queryRow ()

    For receiving and processing a single row of query ()

    For all rows queryAll ()

    To get the queryColumn () column

    To get the first value in the first column of queryScalar ()