Copy link to clipboard
Copied
I have a number of recordsets that on every page, and each recordset on a single page uses the same sql query (well, part of it does).
Instead of having to edit five record sets on every page, I'd like to be able to use a variable in each that refers to as single reference thus making it easier to handle the page results.
I am using static links at the moment rather than database driven links, so I am finding it difficult to figure out how to pass something along the lines of a URL parameter. I don't really want to go down the road of creating database driven dynamic links, so is there a way of programming a variable or parameter into each page or static link?
The sql is very simple for most of the recordsets, here's an example:
SELECT *
FROM tbl_maincontenttext
WHERE fld_webpage = 'EWG'
It's the EWG bit I'd like to make dynamic in some way if at all possible.
Thanks
Mat
Copy link to clipboard
Copied
I have moved your post to the Dreamweaver Application Development forum, which deals with this type of issue.
You don't say which server techology you're using, but this is how you would do it in PHP. The principle is the same for other server technologies.
To link to the page, use a query string. Let's say you're looking for products, the code looks like this:
<a href="somepage.php?product=EWG">Get EWG</a>
Then in the Recordset dialog box, select Filter: URL parameter fld_webpage = product
This creates SQL similar to this:
$recordsetName_query = sprintf("SELECT * FROM tbl_maincontenttext
WHERE fld_webpage = %s",
GetSQLValueString($colname, "text"));