• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active records join problem

#1
[eluser]Ornis[/eluser]
Hello

I tried:

Code:
$this->db->select('tmp_query_vogelbeobachtungen.*','gemeinde.name',FALSE);
            $this->db->from('tmp_query_vogelbeobachtungen');
            $this->db->join('gemeinde', 'tmp_query_vogelbeobachtungen.refto_gemeinde = gemeinde.id', 'left');
            $myquery = $this->db->get()->result_array();

and got an error:

A PHP Error was encountered

Severity: Warning

Message: preg_match() expects parameter 2 to be string, array given

Filename: mysqli/mysqli_driver.php

Line Number: 184


How should I pass the parameter in the join-method?

Thanks Martin

#2
[eluser]KBB[/eluser]
Hey!

The join part looks good, but select a bit messy. According to the manual (http://ellislab.com/codeigniter/user-gui...ecord.html) the select should only have maximum 2 parameters and you pass 3 to it.

Try it like this:
Code:
$this->db->select('tmp_query_vogelbeobachtungen.*, gemeinde.name', FALSE);

#3
[eluser]Ornis[/eluser]
;-) Solved; problem was the to_excel helper that wants an object (db-query) not the result-array.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.