Selecting Multiple values for a user |
5/3/2011 5:51:51 PM |
PHPRunner General questions | |
![]() I just upgraded to the 5.3 version so that I could fix a problem with a project I had previously created. It works great, but now the users have asked for another feature <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=16953&image=1&table=forumtopics' class='bbc_emoticon' alt=':o' /> . I thought it wouldn't be a difficult thing to do. Right now the tables are users/vendors/products/notes |
|
![]() |
Admin 5/4/2011 |
You will need to implement this dependency (user assigned multiple vendors) manually. |
![]() |
greggk author 5/4/2011 |
You will need to implement this dependency (user assigned multiple vendors) manually. You will need to pull a list of vendors available to current user from the database and modify SQL query on the fly accordingly. Here is an example of doing this: http://xlinesoft.com/phprunner/docs/modify_sql_query_on_the_fly.htm
|
![]() |
greggk author 5/6/2011 |
Ok, I tried the many to many relationships, and that is OK, but still doesn't do exactly what I want it to do.
|
![]() |
Admin 5/6/2011 |
Greggk, |
![]() |
greggk author 5/6/2011 |
Greggk, I'm not sure if I explained it well enough. The standard security methods like Dynamic Pemrissions or Advanced Security won't work for you here. You need to implement BeforeSQLQuery event crafting a proper WHERE clause based on IDs of selected vendors for the current user. Hope this makes sense.
|
E
|
electromotive 5/7/2011 |
So, that is the only route? I guess I'll have to dig up some mysql books to see if I can come up with an appropriate statement to pull the multiple vendorIDs from the user table. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=58148&image=1&table=forumreplies' class='bbc_emoticon' alt=':huh:' />
|