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?

How to- Display tables based on user input
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: How to- Display tables based on user input
#58020
How to- Display tables based on user input 7 Years, 9 Months ago Karma: 0
Hi again,

Need your help again. I would like to display tables but this time is based on a user input, say for a user id. Can you show me?

Thank you and kind regards
Last Edit: 2016/07/12 06:30 By admin.
The administrator has disabled public write access.
 
#58021
Re:How to- Display tables based on user input 7 Years, 9 Months ago Karma: 747
Hello,

Use {$UserId} predefined variable in an SQL query. Read here about it in description of "Query" parameter.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58023
Re:How to- Display tables based on user input 7 Years, 9 Months ago Karma: 0
Hi again,

I am really lost and have read the reference that you have given me many times but still not successful. I would like to use the where clause with the predefined variable i.e I would like a value such as user id to be typed in by a user and with that input the query will be implemented for the said user id.

I am lost for ideas, please help

Kind regards
The administrator has disabled public write access.
 
#58026
Re:How to- Display tables based on user input 7 Years, 9 Months ago Karma: 747
You can use request variables in WHERE clause of SQL query. For example you can create a HTML form outside the module where user will enter a search string, click "Search" button and then use data from the form in "WHERE" clause. For example use the following HTML form:

Code:


<form action="" method="post">
 <input type="text" name="searchStr" />
 <input type="submit" value="Search" />
</form>



and use the following SQL query:

Code:


SELECT
 id,
 title
FROM
 #__content
WHERE
 title LIKE CONCAT("%",{$REQUEST:searchStr|empty:''},"%")



Regards,
ARI Soft
The administrator has disabled public write access.
 
#58029
Re:How to- Display tables based on user input 7 Years, 9 Months ago Karma: 0
Hi,

Thank you very much for the reply, but I have spent many hours trying to get it right even after your suggested codes I still cant do it. I am just not getting the concept right.

I got the form in an article, wrote your sql query and then use the button in the editor, or am I doing it the wrong way?

Your help still please

Kind regards
The administrator has disabled public write access.
 
#58030
Re:How to- Display tables based on user input 7 Years, 9 Months ago Karma: 747
SQL query is used into a data source.

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