This topic is locked

SESSION at login from settings table

10/7/2019 12:51:49 PM
ASPRunnerPro General questions
S
silverpc author

Hi again,

im trying to create a SESSION("") at login from a specific table call SETTINGS base on ID so i can use it thru out the pages.
table name SETTINGS
ID Color quantity total

1 Blue

2 2

3 100

so in any table if i use SESSION("color") i get it from record ID=1 and SESSION("quantity") will be get from ID=2
i try the following in after login but didn't work

dim sql

sql = "Select Color FROM Settings WHERE ID='1'"

CustomQuery(sql)

SESSION("Color")= sql


any help on this ? thank you

admin 10/8/2019

If you only need to read a single value from the database using DBLookup is the easiest option:

https://xlinesoft.com/asprunnerpro/docs/dblookup.htm

S
silverpc author 10/12/2019

thank you admin.

How can I apply this to be read at "javascript onload event"?

admin 10/12/2019

You cannot. Sessions and database operations do happen on the server-side while Javascript events happen on the client-side in the web browser.
Probably you need to explain what exactly you trying to achieve so we can suggest a viable approach.

S
silverpc author 10/16/2019

Ok, what Im trying to do is to have "AdminConfig" pages, and users see in the rest of the pages only what admin assign to see like clients, territories, groups, services and products

for example:
1 ADMIN assign to user JOHN to work with and sale products to companies GLOBAL and SQUARE
User Companies companyID

JOHN GLOBAL 101

JOHN SQUARE 583
on "AssignedCompanies" page needs to hide all other companies except the GLOBAL and SQUARE assign on "AdminConfig"
2 on "services" page see only records associated to the companies by CompanyID all other record to be hide
3 JOHN is been assign to sale only category 1 and 3 products that can be selected from a list of multi checkbox and drop downs from lookup wizard
user PRoductID

JOHN 1

JHON 3
i want to hide the multi checkbox and drop downs if are empty (no products on that category ) or if are for category 2 and 4
i hope all this make sense to you.. !

admin 10/16/2019

It makes some sense but we would need to see the actual project and database structure to provide meaningful advice.
I recommend uploading your project to Demo Account and contacting support directly at https://xlinesoft.com/dss/support.asp