Form Validation Forum :: re: Check unique record from RS
This thread was displayed: 0 times
Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.
For more information about the affected products visit: www.interaktonline.com/Support/
Edward Gilbert
05-09-2007 03:31:27 GMT +2
|
Hi,
I followed your instructions from my last post and was able to put togather this custom trigger. However it does not work. could you please look at it and let me know what the problem is. thank you.
query = "SELECT project_name FROM projects WHERE project_user_id = %d AND project_name = "%s"', Session("kt_login_id"), tNG.getColumnValue("project_name"))
rsCheck = tNG.connection.Execute(query) or die(tNG.connection.ErrorMsg())
if(rsCheck && rsCheck->RecordCount() > 0)
return new tNG_error('Name already exists!', array(), array())
Set Trigger_Custom = nothing
I am not that good at converting PHP to ASP so if you could please help me I would appreciate it.
|
|
|
Razvan Racasanu[InterAKT]
05-09-2007 14:43:49 GMT +2
|
Hello,
Try with the attached file which is a modified version of the file you attached.
Regards,
Razvan RACASANU
|
|
|
Edward Gilbert
05-10-2007 04:25:26 GMT +2
|
Hi,
I have tried everything to try to get this script to work. All I need is to be able to compair a form field called "project_name" to a mysql database query result of a column also named "project_name". I have played arround with this script for hours and the closet I can get to a working script is what I am attaching now. I keep getting this error running this script after I hit the submit button. Wrong_number_of_arguments_or_invalid_property_assignment:_'result.RecordCount',
Please look at what I have and tell me if you can help me.
thank you
PS
the page you sent me did nothing. all duplicate records were still submitted as if the trigger wasn't even on the page.
|
|
|
Ionut MOICIANU
05-18-2007 14:43:50 GMT +2
|
Hi,
If you only need to search for the project_name value within the database and don't need a second condition (like project_user_id = session("kt_login_id")) then you don't need a custom trigger, but you will simply use the "Check Unique Key" trigger. This should work fine.
Regards,
Ionut
|
|
|