I'm using MySql / PHP / DW
I have a 'login.php' page which has two fields USERNAME & PASSWORD, and a 'jobs.php' page which displays a list of Client's jobs.
I need Client A to log in and only see Client A's jobs and so on for my various clients...
I have two tables, USER and JOBS.
client_id (primary key)
job_id (primary key)
I need 'jobs.php' to display Client A's jobs based on the username and / or password he has entered.
Do I have to create a query in MySql or can I achieve this within DW in recordsets or something? I'm very confused!
When you check whether the entered username and password values match the ones in the database, retrieve the id of that record and set it to a session variable or a temporary cookie. Then on the page on which you want to display the Client records create a recordset based on your main table and filter it with the id value in the session variable. This should do it.
To filter the recordset with the session variable your SQL statement would contain something like this:
I had to do something very similar using .asp and MSaccess many years ago, back then I had to create a query in Access which merged the two tables together and then I created a recordset from it in Dreamweaver. Can I replicate this using MySql / Phpmyadmin and have the query show up in Dreamweaver so I can create a recordset from it?
Back to present day...How do I retrieve the id of a record?
On the client records page I have entered this data below - can you tell me if this is correct? When I test it records are displayed but when I preview in browser the records page comes back empty.
I don't know if DW has any such built-in functionality. I do have extensions which do it but you can hand code it just as easily.
You obtain the id of the last insert by using this:
Europe, Middle East and Africa