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?

{$REQUEST:var1} help
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: {$REQUEST:var1} help
#27340
{$REQUEST:var1} help 12 Years ago Karma: 0
Hello,
I have two questions:

1-
I want to include a variable in the sql query.

my query is :
SELECT DRO_District_Site ..............
FROM table
where Date='2012-04-03' group by......;

the date is variable. should i do:

SELECT DRO_District_Site ..............
FROM table
where Date={$REQUEST:var1} group by......;

if yes can I set var1 in an article body where the module is embedded?

or in the module code? if in module code which file exactly?

Regards
The administrator has disabled public write access.
 
#27344
Re:{$REQUEST:var1} help 12 Years ago Karma: 748
Hello,

Request variables are set in an URL (GET variables) or send via a HTML form (POST variables). If you want to use PHP variables, you can modify class.DataTablesDataSqlModel.php file and use an extension like DirectPHP to set variable in an article.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#27346
Re:{$REQUEST:var1} help 12 Years ago Karma: 0
I have a content plug in that allow me to create a HTML/PHP form and send to the same page as GET or POST.

my form field is Date. And I am able to get it in the URL.

now what should I do in the module query to use the Date in the where statement i.e. where Date= $date.

is the following what should I do in class.DataTablesDataSqlModel.php?
$params = array(......
.........
'Dat1' => $Date->get("Date")

then should I use the query as the following:

.............where date={$Date}
The administrator has disabled public write access.
 
#27347
Re:{$REQUEST:var1} help 12 Years ago Karma: 748
We don't know structure of your table and date format which is used in "Date" variable (probably it is not compatible with MySQL date format). Could you provide a link to a page where we can see the module and a form?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#27348
Re:{$REQUEST:var1} help 12 Years ago Karma: 0
My website is not published online yet. The date is a string not a datetime format.
The administrator has disabled public write access.
 
#27349
Re:{$REQUEST:var1} help 12 Years ago Karma: 748
Try to set "SQL -> Debug mode" parameter to "Yes" in module settings to see what error occurs in a SQL query.

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