I have a query that needs to check whether the record is still active before it includes it in the query. Now my problem is that the record status of that record is in another database and WE all know that we cant join tables from different databases.
What I want to do is to create a view from the other database and I'll just join that view to my query. The problem is HOW can I create a view and select data from it in CodeIgniter?
Thanks in advance.
By the way, Im not the one who designed the database. -Company defined-
Heres a sample of my query, its not the exact one since it includes a lot of tables. I hope I could give you a hint of what I'm trying to do.
SELECT count(IDNO), course, sum(student_balance)
FROM student_balances
WHERE school_term = '2013' AND student_balance > 0
GROUP BY course
ORDER BY course
All student records there are selected regardless if its enrolled or not. there is a table containing enrolled students of the current school year which that table is from another database. I want to count only the records of students that are enrolled.