Welcome Guest, Not a member yet? Register   Sign In
need help in query
#1

[eluser]Unknown[/eluser]
This is the required query itz working fine in the ordinary case
SELECT DISTINCT(SUBSTR(name,1,1)) FROM (`port`) WHERE `iso` = 'AD'

but the problem is when i shift it to codeignitor
code:

$this->db->distinct();
$this->db->select('SUBSTR(name,1,1)');
$this->db->from('port');
$this->db->where('iso',AD);
$query = $this->db->get();

iam getting error,

result query:

SELECT DISTINCT SUBSTR(port_name, `1`, `1`) FROM (`country_port`) WHERE `country_iso` = 'AG'

MySQL server version for the right syntax to use near 'FROM (`country_port`) WHERE `country_iso` = 'AG''this is the error am getting
#2

[eluser]Krzemo[/eluser]
http://ellislab.com/codeigniter/user-gui...tml#select
check part mentioning second optional select parameter




Theme © iAndrew 2016 - Forum software by © MyBB