Welcome Guest, Not a member yet? Register   Sign In
I need to get data from different table using sql query
#1

Hi, Iam new to CI4 and have been exploring it for a couple of weeks now. I usually create an instance of Model in the Controller for performing Database operations. But now I need to get data from different table using sql query (for example: select user.*,country.countryname from user,country where user.country=country.countryid) Here the PK of Country table is stored in the 'country' field of user table, I need to get the corresponding country name from country table. This was easy by just executing the query in normal php. Since I'm new to CI4, a little in trouble with this. Any help would be very much appreciated.

Thanks in advance.
Reply


Messages In This Thread
I need to get data from different table using sql query - by shameelhp - 07-22-2021, 08:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB