0

I'm writing an interface for a database using medoo and I'm trying to use INNER JOIN when executing a query:

$this->db->select("oc_t_item_description", [

   //join

   "[><]oc_t_item" => ["fk_i_item_id" => "pk_i_id"]

   ],

   [
       //columns

       "*"




   ]



   );

The query itself works fine:

 SELECT * FROM oc_t_item_description
     INNER JOIN oc_t_item ON oc_t_item.pk_i_id =     oc_t_item_description.fk_i_item_id

I followed the example provided here:

http://medoo.in/api/select

The query runs just fine, but when I try to replicate it in medoo, it fails. I know that medoo is connecting to the database just fine etc...because I have run other queries through it just fine. However, I am stumbling with this INNER JOIN.

What am I doing wrong?

not_this_again
  • 131
  • 3
  • 7
  • Can you show the query that is generated by medoo? (by calling `echo $this->db->last_query();`). Are you sure it's exactly the same with your raw query? – Niyoko Nov 07 '16 at 01:08
  • I just get bool (false) back. Am I completely sure? I designed it to be the same, but of course given that it is not working I must have mangled something somewhere. I meant to say that I wrote the medoo code based off the query. Sorry for the lack of precision. – not_this_again Nov 07 '16 at 02:16
  • You should not using `*` for columns. It will be conflict while joining two table with same column name. – Angolao Mar 26 '17 at 12:12

0 Answers0