Back in May I explained how to create MySQL striped views with session variables. A couple folks wanted to know how to implement them through PHP programs. The trick is sharing the same connection between a call to the function before a query against the striped view.
I’ve updated the MySQL example beyond the Hobbit analogy from the prior post. It now uses the following database components:
- An
APPLICATION_USER
table - A striped
AUTHORIZED_USER
view - A
FUNCTION_QUERY
view to optimize function calls - A
SET_LOGIN
function - A
GET_LOGIN
_ID function - A
GET_USER_ID
function
The definition of the APPLICATION_USER
table is:
CREATE TABLE application_user ( user_id …[Read more]