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?

SQL Query and $REQUEST
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: SQL Query and $REQUEST
#52894
SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 0
Hi

With Ari Smart Content Datatable I want to use the SQL query $REQUEST to select some records.
I would like to pass a parameter from one joomla article page1 to another, page2 containing
{arimodule id="xx"}{/arimodule}

example:
<a href="index.php/page2?code=YYYYY>List</a>

in page2
{arimodule id="xx"}{/arimodule}

and the SQL query has
{$REQUEST:code}

It is possible?
What is the exact syntax?

another question

I may use?
{arimodule id="xx" code="YYYYY"}{/arimodule}

I'm no expert. Please, I would like, if possible, an explanation for dummies.

Thank You
The administrator has disabled public write access.
 
#52899
Re:SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 747
Hello,

You can read how to use request variables in SQL query here (see description of "Query" parameter).

For example if you want to convert values of "title" column to hyperlinks, open SQL query settings page, set "Columns settings -> ID" parameter to title value and "Columns settings -> Format" parameter to the following value:

Code:


<a href="index.php/page2?code=YYYYY">{$value}</a>



If you want to send value from "code" column, use the following code in "Columns settings -> Format" parameter:

Code:


<a href="index.php/page2?code={$columns:code}">{$value}</a>



Regards,
ARI Soft
The administrator has disabled public write access.
 
#52969
Re:SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 0
I think I have not explained well.

The hyperlink that calls page2 is fixed and is handwritten by creating joomla article. It is not from a Datatable

for example

on page X I have
<a href="index.php/page2?code=XXXXX> TextX </a>

on page Y I have
<a href="index.php/page2?code=YYYYY> texty </a>

and on page Z I have
<a href="index.php/page2?code=ZZZZZ> TextZ </a>

Datatable is in page2
And I want to write the SQL query

SELECT 'id','title','date' FROM 'mytable' WHERE 'id'={$REQUEST:code}

What is the exact syntax in the url parameter and 'id'={$REQUEST:code} to work well?

Thanks
The administrator has disabled public write access.
 
#52970
Re:SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 747
If you are working with MySQL database, use the following query:

Code:


SELECT 
  `id`,
  `title`,
  `date`
FROM 
  `mytable`
WHERE 
  `id` = {$REQUEST:code}



Regards,
ARI Soft
The administrator has disabled public write access.
 
#52971
Re:SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 0
This syntax is to try to use, but I get the following error:

DataTables warning: table id = dt_137 - Ajax error. For more information about this error, please see datatables.net/tn/7

If I use SELECT 'id', 'title', 'date' FROM 'mytable' WHERE 1

Datatable works Ok but, logically, with all records.

Why?

Thanks
The administrator has disabled public write access.
 
#52972
Re:SQL Query and $REQUEST 9 Years, 3 Months ago Karma: 747
Currently the extension doesn't support ability to use request variable when server side pagination is enabled. Set "Server side pagination" parameter to "No" in module settings.

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