Thanks for your reply. I dont seem to have much luck with cookies for some reason, I dont know what it is!!! lol.
Here is what is going on, when a user logs into the web page first time, their Username is stored in a cookie (to last 365 days, that's what I set it at) on a mobile device. The user then completes their work orders and finally logs out.
This means the next time they go to the login page it will automatically check who the user is using the cookie; display the following days work order count associated with that particular engineer. So I guess if the work order count is zero then they wont login. Saves a bit of time for them. So no Session variable in use.
So so far I have selected the Form on the page and got it to 'Set Cookie Value' to 'cookusername' and this is retrieved from the username field. I then went to the body section of the page and 'Set The Form Element From' 'cookusername'. So now when the page loads I can see the users name already sitting in the username field.
So far its working fine:
When I try to use it as a variable in the recordset it doesn't work. The recordset works without the variable and displays all the records for every user. Below is the SQL code and basically it shows all work orders for the following day only.
FROM workorders LEFT JOIN customers ON workorders.customerid = customers.customerid
WHERE workorders.workorderdate BETWEEN DATE_SUB(CURDATE(), INTERVAL -1 DAY) AND DATE_ADD(CURDATE(), INTERVAL 1 DAY) and workorders.employeename = colname
The colname variable details are
Default value: -1
Runtime value: $_COOKIE['cookusername']
I have checked that the usernames in the database table are all spelt correctly but still nothing!!!
Can you help?