Codeigniter Active Record Type [Duplicate]Php

Кемеровские программисты php общаются здесь
Anonymous
Codeigniter Active Record Type [Duplicate]

Сообщение Anonymous »

Я попытался получить umat_id < /code> с этим SQL -запросом: < /p>

SELECT umat_id FROM msumat WHERE nama = $nama
< /code>

Я преобразовал этот запрос SQL в активную запись CI: < /p>

$this->db->select('umat_id');
$terdaftar = $this->db->get_where('msumat', array('nama' => $nama));


So this query should return a string (example : "John").

But I got an error when I tried to echo it :
Object of class CI_DB_mysql_result could not be converted to string

I have tried something like this : Echo (String) $ terdaftar; < /code>, но он не работает. Как это сделать? < /P>

$john = ????


Подробнее здесь: https://stackoverflow.com/questions/152 ... eturn-type

Вернуться в «Php»