Welcome Guest, Not a member yet? Register   Sign In
FROM is adding 1 to SQL..
#8

(07-02-2018, 12:41 PM)dave friend Wrote:
(07-02-2018, 02:22 AM)sDenizhan17 Wrote:
(06-28-2018, 04:22 PM)dave friend Wrote: The first argument to get_where should be the name of the table. Fix that and see what happens.

PERS is name of the table.

Your code

PHP Code:
->get_where(array('PERS.id' => $person_id)); 

supplies only one argument. Try

PHP Code:
->get_where('PERS', array('PERS.id' => $person_id)); 

On further consideration, you could probably do this

PHP Code:
$company $ci->db
    
->select('*')
 
   ->from('musteriler as MUST')
 
   ->join('ilgili_kisiler AS PERS''PERS.musteri_id = MUST.id''inner')
 
  ->where(array('PERS.id' => $person_id))
 
  ->get(); 

I believe that select('*') in combination with the join statment will give you all fields from both tables.

Thank you dave.. 

You right. I forgot write the first argument to get_where. When i write it fixed.
Reply


Messages In This Thread
FROM is adding 1 to SQL.. - by sDenizhan17 - 06-28-2018, 08:06 AM
RE: FROM is adding 1 to SQL.. - by php_rocs - 06-28-2018, 09:12 AM
RE: FROM is adding 1 to SQL.. - by sDenizhan17 - 07-02-2018, 02:23 AM
RE: FROM is adding 1 to SQL.. - by dave friend - 06-28-2018, 04:22 PM
RE: FROM is adding 1 to SQL.. - by sDenizhan17 - 07-02-2018, 02:22 AM
RE: FROM is adding 1 to SQL.. - by dave friend - 07-02-2018, 12:41 PM
RE: FROM is adding 1 to SQL.. - by sDenizhan17 - 07-03-2018, 02:04 AM
RE: FROM is adding 1 to SQL.. - by php_rocs - 07-02-2018, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB