anhphuong Posted January 18, 2019 Share Posted January 18, 2019 Hey Guys, I'm building a site to view images on, basically the image detail is stored in a database, the site is then accessed and a standard select query is used. I then get the image name etc pulled from the database. Is there a way to save that image name into a variable and get it to display on a form that is run from a function - completely independent to my viewing code... Some sort of global variable, but that could change each time I viewed a different photo - and wouldn't have any effect on anyone else browsing the site etc - so the correct image name would always be passed? Quote Link to comment Share on other sites More sharing options...
maxxd Posted January 18, 2019 Share Posted January 18, 2019 You would simply pass the database query results (or portions thereof) to the function that outputs (or collates the data for) your form. It certainly doesn't need to be a global variable, unless I'm misunderstanding what you're asking. Post the code you're working with and we'll all have a better idea of what's going on. Quote Link to comment Share on other sites More sharing options...
fidodido Posted January 24, 2019 Share Posted January 24, 2019 Another way is to store the variable in a session Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.