close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validate unique before inserting record

Thread began 3/21/2014 5:30 pm by Brendan | Last modified 3/26/2014 6:26 pm by Jason Byrnes | 269 views | 3 replies |

Brendan

Validate unique before inserting record

Is it possible to add a validation to an insert single record behavior for the following scenario:

table structure - record_Id | user_id | date (Y-m-d)

The insert record behavior is on a WADAusers login page. When the user successfully logs in, it records an auto increment record_Id, the user_Id, and the current date in Y-m-d format. I would like to prevent a user from logging in more than once per day. But there will be multiple users logging in each day, so I can't make the date column unique.

Thank you

Sign in to reply to this post

Jason ByrnesWebAssist

it is possible, but will require some hand coding

add a recordset to the page that will lookup the users ID and the date, a recordset will create a variable named:
$totalRows_<RecordsetName>

use the set session value server behavior to store the total rows variable in a session

you can theedit the security assist access rules, WebAssist -> Security Assist -> Manage Site Access -> Access Rules Manager

and add a condition to the logged in <your user table> rule:

Restrict If
$totalRows_<RecordsetName> Session Variable
Is Greater Than (>)
0

make sure that this condition comes before the existing condition to:
Allow if
User ID session Variable
is not equal (<>)
"" (<- Blank value)

Sign in to reply to this post

Brendan

Since the login page is using the WADAusers recordset, and i'm trying to lookup the userId in another table, should I include the following in the new recordset


SELECT runs.user_Id, runs.run_Date
FROM runs
WHERE runs.user_Id = paramUserSession

paramUserSession = int / -1 / $_SESSION['SecurityAssist_user_Id']

Sign in to reply to this post

Jason ByrnesWebAssist

"add a recordset to the page that will lookup the users ID and the date"

that recordset will look up the ID, you need another criteris to lookup todays date

Sign in to reply to this post

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...