Hi,
how to save a sql query in a variable ? , for example:
I have the following query:
Code:
$country = $this-> db- > query ("select country from users where email = '$email' and password = '$password' " ) ;
I want to store that user's country in a variable : Example $var_country = Brazil
Code:
$var_country = $country;
But when I use the variable gives the following error:
Code:
A PHP Error was encountered
Severity : 4096
Message : Object of class CI_DB_mysql_result could not be converted to string
Thanks ^^