Welcome Guest, Not a member yet? Register   Sign In
consulting variable
#1

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 ^^
Reply


Messages In This Thread
consulting variable - by pompeu - 04-06-2015, 01:30 PM
RE: consulting variable - by CroNiX - 04-06-2015, 02:06 PM
RE: consulting variable - by pompeu - 04-06-2015, 02:31 PM
RE: consulting variable - by CroNiX - 04-06-2015, 02:57 PM
RE: consulting variable - by pompeu - 04-06-2015, 03:08 PM
RE: consulting variable - by CroNiX - 04-06-2015, 03:30 PM
RE: consulting variable - by pompeu - 04-06-2015, 03:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB