https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× This is the optional Forum header for the Suggestion Box.

SELECT / WHERE statement provided by URL?

  • dpayer
  • dpayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago #1208

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.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #1215

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ž

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #1396

How can be the WHERE statement if the parameter is in the URL?

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #1411

Table JX processes the url and puts some parameters into where statement that is executed afterwards.

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #1434

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

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #1436

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

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.147 seconds

Contact Us

Contact us on Discord

Contact us on Facebook