close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Search recordset based on cookie value

Thread began 6/22/2011 4:54 am by acaciasd344844 | Last modified 6/30/2011 7:33 am by acaciasd344844 | 3197 views | 8 replies

acaciasd344844

Hi Jason,

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.

SELECT *
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

name: colname
Type: Text
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?

Thanks Jason

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...