Welcome, Guest
Username: Password: Remember me
This is the optional Forum header for the Suggestion Box.

TOPIC: SELECT / WHERE statement provided by URL?

SELECT / WHERE statement provided by URL? 2 years 10 months ago #1208

  • dpayer
  • dpayer's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Would it be possible to supply the WHERE statement (of the select) for the grid (normally provided in the admin section that defines the grid) by URL?

Example: mysite.com/mygridpage&where="column1=value"

(not exactly urlencoded but I wanted to make a point)

This way you can do the same as a search but be more specific and create a menupage with options.

David P.
The administrator has disabled public write access.

Re: SELECT / WHERE statement provided by URL? 2 years 10 months ago #1215

  • tomaz
  • tomaz's Avatar
  • OFFLINE
  • Administrator
  • Posts: 670
  • Thank you received: 46
  • Karma: 7
Hi,

I am sorry, but this is not possible and it could be a serious security issue. However you can set search conditions through url.

Example: mysite.com/mygridpage?s_f=searchfield&data_search=searchstring

If you want to set more specific where condition, you can always define more grid views in your administrator interface, and display them on several pages.

Regards,

Toma┼ż
How about posting a review on JED? Table JX, Card View JX, Paid Downloads JX
The administrator has disabled public write access.

Re: SELECT / WHERE statement provided by URL? 2 years 7 months ago #1396

  • artiston
  • artiston's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
How can be the WHERE statement if the parameter is in the URL?
The administrator has disabled public write access.

Re: SELECT / WHERE statement provided by URL? 2 years 7 months ago #1411

  • tomaz
  • tomaz's Avatar
  • OFFLINE
  • Administrator
  • Posts: 670
  • Thank you received: 46
  • Karma: 7
Table JX processes the url and puts some parameters into where statement that is executed afterwards.
How about posting a review on JED? Table JX, Card View JX, Paid Downloads JX
The administrator has disabled public write access.

Re: SELECT / WHERE statement provided by URL? 2 years 7 months ago #1434

  • Fisch
  • Fisch's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
I can't get this to work:

www.woodpelletprice.com/beta/registratio...State&data_search=MA

My grid is is: www.woodpelletprice.com/beta/registration/new-grid-test and I'm trying to filter the State field which is referred to in the view (at the bottom)


CREATE OR REPLACE VIEW vw_pellet_listing AS
SELECT WPL.loc_name AS Seller,
WPL.rel_loc_company as Retailer_id,
wp.pell_in_phone AS Phone,
PB.pell_brand_website as Brand_Website_URL,
wp.pell_in_city AS City,
PB.pell_brand_name AS Brand,
WT.type AS Wood, PQ.quality AS Quality,
Concat('$', Format(wp.pell_price, 0)) AS '$/Ton',
CASE WHEN wp.pell_in_stock = 1 THEN '<span style="color:green;"> ✔ </span>' ELSE '<span style="color:red;">☒ </span>'END AS Stock,
DATE_FORMAT( wp.time_date_m_pell, '%m/%e' ) AS Updated,
CASE WHEN wp.pell_delivery = 1 THEN '<span style="color:green;"> ✔ </span>' ELSE '<span style="color:red;">☒</span>' END as Delivery,
wp.pell_in_state AS State
FROM WP_pellets AS wp
JOIN WP_pellet_brands AS PB ON PB.pell_brand_id = wp.pell_brand
JOIN woodtypes AS WT ON WT.id = wp.pell_wood_type
JOIN pell_qual AS PQ ON PQ.id = wp.pell_quality
JOIN WP_locations AS WPL ON WPL.location_id = wp.pell_rel_location
WHERE wp.pell_displayed =1 and WPL.is_pellet_retailer =1
ORDER BY WPL.loc_name, PB.pell_brand_name


Any assistance would be greatly appreciated.

Thank you,

Seth
The administrator has disabled public write access.

Re: SELECT / WHERE statement provided by URL? 2 years 7 months ago #1436

  • tomaz
  • tomaz's Avatar
  • OFFLINE
  • Administrator
  • Posts: 670
  • Thank you received: 46
  • Karma: 7
Hi,

You didn't follow the syntax exactly.

Try this: www.woodpelletprice.com/beta/registratio...State&data_search=MA
http://www.woodpelletprice.com/beta/registration/new-grid-test?s_f=State&data_search=MA
How about posting a review on JED? Table JX, Card View JX, Paid Downloads JX
The administrator has disabled public write access.
Time to create page: 0.122 seconds