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?

parametric sql query
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: parametric sql query
#19458
parametric sql query 12 Years, 7 Months ago Karma: 0
Hi i just bought Ari Data table module.

I have one separate mysql database from my Joomla installation where the first table has "Questions" and the second table has the "Answers". I created two modules of Ari table. The first displays inside an article the entire table of the "Questions" where article&id=1 and i have managed to create a link on a primary key "QuestionId" column:

sample:
<a href="index.php?option=com_content&view=article&id={$columns:QuestionId}">{$value}</a>

How i will link the value of the table column QuestionId from questions table (as i did in the sample) with the answers table.

Ideally when i click on primary key link of questions table i would like to display the relates "answers" from answers table. (Master Detail approach)

Please advice...!
The administrator has disabled public write access.
 
#19467
Re:parametric sql query 12 Years, 7 Months ago Karma: 748
Hello,

Request variables can be used in a SQL query. For example, if answers table contains "QuestionId" column, you can use the next SQL query to select answers for specific question:

Code:


SELECT
 *
FROM
 answers
WHERE
 QuestionId = {$REQUEST:QuestionId}



Regards,
ARI Soft
The administrator has disabled public write access.
 
#19532
Re:parametric sql query 12 Years, 7 Months ago Karma: 0
I tried some changes...

I changed the hyperlink for the first column of the Questions table so all Questionid columns call the same article for the answers parametric query

<a href="index.php?option=com_content&view=article&id=3">{$value}</a>



I created a second Ari table module with the query that you suggested me with the query:

SELECT
*
FROM
`dbo.Answers`
where QuestionId={$REQUEST:QuestionId}


and the result was : No data available

i enable the SQL Debug mode and i have that results

(mysql): SELECT * FROM `dbo.Answers` where QuestionId=
Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
No data available.

when i run an example of the second query for specific QuestionId

SELECT
*
FROM
`dbo.Answers`
where QuestionId=900

Everything is ok

So something is going wrong with the part of the query "where QuestionID={$REQUEST:QuestionId}"


Please give me your email to provide you with the credentials of this site if you are able to take a look...or please advice me...

Thank you in advance!
Last Edit: 2011/09/12 09:11 By acevk.
The administrator has disabled public write access.
 
#19535
Re:parametric sql query 12 Years, 7 Months ago Karma: 748
Send credentials by this email please.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#19537
Re:parametric sql query 12 Years, 7 Months ago Karma: 748
Try now please. "Format" parameter should look like:

Code:


<a href="index.php?option=com_content&view=article&id=3&QuestionId={$value}">{$value}</a>



Regards,
ARI Soft
The administrator has disabled public write access.
 
#19539
Re:parametric sql query 12 Years, 7 Months ago Karma: 0
Thank You very much !!!!!It is exact what want to have!

It is the first time that a support provide so fast a solution!

I should report it in Joomla forum also...That kind of modules and so good support should be mentioned!!!!

Thank you again!!!!!
Last Edit: 2011/09/12 10:46 By acevk.
The administrator has disabled public write access.
 
Go to topPage: 1