Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Passing parameters to SQL
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Passing parameters to SQL
#68956
Passing parameters to SQL 2 Years, 5 Months ago Karma: 0
Hi,

Is there a worked example of passing parameters to a SQL query? I want to display only the first few columns on the first page and then when the user clicks on a link, it opens a new page with just the individual record showing (with all the other fields).

What I really need to know is the format for the SQL in the sub page and the link on the main page (and how it is set up).

Thanks
Steve
The administrator has disabled public write access.
 
#68964
Re:Passing parameters to SQL 2 Years, 4 Months ago Karma: 760
Hello,

If you want to use request parameters in SQL query, it will look like:

Code:


SELECT
 id, title
FROM
 #__content
WHERE id = {$REQUEST:VAR_NAME}



Just replace VAR_NAME with variable name. For example if want to pass ID via article_id variable, it will look like:

Code:


SELECT
 id, title
FROM
 #__content
WHERE id = {$REQUEST:article_id}



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1