![]() |
Multi Table Select (Active Records) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Multi Table Select (Active Records) (/showthread.php?tid=407) |
Multi Table Select (Active Records) - PHP Warner - 11-30-2014 I am trying to check multiple databases with user given string. But SQL query always returns true. It must return false, if phone number exist in individual or corporate databases. Individual Users Database: Code: | id | name | phone | gender | Corporate Users Database: Code: | id | name | phone | company | PHP: PHP Code: $phone = '5551928321'; // $this->input->post('phone', true); I will be very pleased if someone light me up for see how it will be work. Thank you so much. RE: Multi Table Select (Active Records) - Smith - 11-30-2014 Why did you save data in different databases? You can create a single database with two tables. One for "Individual Users" and other for "Corporate Users ". then you do a join. Sorry for my poor english ![]() RE: Multi Table Select (Active Records) - Rufnex - 12-01-2014 You have to use the database names for your tables like db1.individual and db2.corporate And you have to connect to both of course ![]() RE: Multi Table Select (Active Records) - ivantcholakov - 12-01-2014 A model's method (returns boolean) that includes two separate queries? RE: Multi Table Select (Active Records) - bclinton - 12-01-2014 Assuming you meant different tables, not different databases... Have you tried to debug by using the profiler $this->output->enable_profiler(TRUE) or sending $this->db->last_query() to the log? Does the query shown by one of the above commands work if you run it manually at the command line or in something like PhpMyAdmin? |