Forum Moderators: coopster
I have a solid login and members area/search page. On registration, I associate two fields to both tables in my database, one being the data records table and the other being obviously the user data table.
I need to know two specific tasks here.
1. How to make the user_id and company_id from the registration form echo to show on the user's member page.
(Please tell me that it is as simple as an insert statement and a standard echo.)
2. How to restrict the search page to only search and display data results related between that specific user_id and company_id so that they don't access all of the data listings, just their's.
I am thinking this one is something like this:
query...WHERE 'production.company_id'='user.company_id'
Which would isolate the relation and give me the specifics that I'm looking for without revealing everything, would it not?
This is for a company that wants to display a 'job-in-progress' option for their clients over the web.
Thanks and happy holidays!
If it is coming from the form you could just echo it out directly:
echo 'User ID: '.$_POST['user_id'];
echo 'Compant ID: '.$_POST['company_id'];
If you are going to need these values in the future maybe you want to use session [php.net] variables and then echo it out that way:
echo 'User ID: '.$_SESSION['user_id'];
echo 'Compant ID: '.$_SESSION['company_id'];
As for your second question, your example query segment looks like it should do what you want it to. Try it out first and see what you get.