Mike,

See my comments in red below – hopefully this gets you thinking in a different 
direction…

James E. Thomas
Enterprise Practice Support Systems Manager

Baker Botts L.L.P.
[email protected]<mailto:[email protected]>
T +1.713.229.2196
F +1.713.229.8130
M +1.832.373.8117
910 Louisiana Street
Houston, Texas 77002
USA
[bblogo]<http://www.bakerbotts.com/>
[linkedin]<https://www.linkedin.com/company/baker-botts-llp?trk=hb_tab_compy_id_8300>
 [youtube] <https://www.youtube.com/channel/UCgys2C8DwRY-BVN079QNnwQ>  
[facebook] <https://www.facebook.com/BakerBottsLLP/>  [instagram] 
<https://www.instagram.com/bakerbotts/>  [twitter] 
<https://twitter.com/bakerbotts>

From: [email protected] [mailto:[email protected]] On Behalf Of 
Mike Gillespie
Sent: 22 March, 2018 8:35 PM
To: Houston ColdFusion Users' Group <[email protected]>
Subject: Re: [houcfug] SQL Query help

I already use something similar to this, but since I cannot be sure of the 
range I am looking for, this solution won't work for me.  This is actually 
pretty much what I am trying to replace with something better.

Lets see if I can explain better what I am trying to solve.

I have a page that lists items for sale  it.  Is is paginated, 25 per page.  
The page also has filters on it so that you can reduce the page count.

Are you using DataTables for your data grid output? We use it extensively in 
projects where a data grid with pagination, filtering, etc. is required. Very 
easy to use and very powerful (and extensible). Also very CFML-friendly.

I want to link to a specific product and highlight it -which is super simple, 
until you need to figure out all the filters and the specific page that product 
shows up on.

I was with you until you said “until you need to figure out all the filters and 
the specific page the product shows up on” – I’m going to travel into the 
future and use the next question to ask if you are showing the product in a 
modal, isn’t the modal page being called doing its own queries to pull up the 
product based on a passed product ID and/or additional info? You’re not 
creating a modal for every product on that page currently at run time and then 
displaying them, are you?

Each row in your tabular data output (e.g., each row in your table displaying 
the product info, and presumably a hyperlink that invokes the modal) should be 
able to have the correct params for each item at the time the table row is 
generated by a CFLOOP.

I think a bit more detail is needed to understand the issue here.

I currently do not have a separate "detail" page for the products, instead, 
click the product and you get a modal window with the detail (and additional 
add to cart button).

So this modal shows the detail of the product, based on the passed params – is 
the script that does the query to lookup the product info and populate the 
modal being called inside a modal DIV or similar structure?

Using javascript and a hash and URL params isn't working well in all browsers.

page.cfm/?f1=A&f2=B&f3=C#hashforsku or even page.cfm#hashforsku/?f1=A&f2=B&f3=C

Why do you have a “/” after page.cfm? why not page.cfm?f1-A&… ?

Params load page correctly, capture the hash to open the modal with javascript

I could just add another param

page.cfm/?f1=A&f2=B&f3=C&product=sku

But that opens a whole other can of worms with my security module (I only use 
integers in url params and a module to deal with non-integers)

If you have a module to deal with non-int, then what’s the issue with passing 
the SKU as a param? Can you look up a product only by say ProductID or similar, 
and then call the SKU inside the modal (if needed)? Or is the SKU the unique 
identifier?

working alone sometimes sucks - once in a while I need a sounding board..

Thanks again,

M

M

On Thursday, March 22, 2018 at 7:08:36 PM UTC-5, 
[email protected]<mailto:[email protected]> wrote:
This might help: 
https://stackoverflow.com/questions/30068252/mysql-query-to-return-the-range-of-coordinates

James E. Thomas
Enterprise Practice Support Systems Manager

Baker Botts L.L.P.
[email protected]<javascript:>
T +1.713.229.2196
F +1.713.229.8130
M +1.832.373.8117
910 Louisiana Street
Houston, Texas 77002
USA
[bblogo]<http://www.bakerbotts.com/>
[linkedin]<https://www.linkedin.com/company/baker-botts-llp?trk=hb_tab_compy_id_8300>[youtube]<https://www.youtube.com/channel/UCgys2C8DwRY-BVN079QNnwQ>
 [facebook] <https://www.facebook.com/BakerBottsLLP/>  [instagram] 
<https://www.instagram.com/bakerbotts/>  [twitter] 
<https://twitter.com/bakerbotts>

From: [email protected]<javascript:> 
[mailto:[email protected]<javascript:>] On Behalf Of Mike Gillespie
Sent: 22 March, 2018 7:05 PM
To: Houston ColdFusion Users' Group <[email protected]<javascript:>>
Subject: [houcfug] SQL Query help

Hey y'all,

Sure hope you can help with this one.

Is there a way to write a sql query for MySQL such that it returns recordset of 
say 100 rows with my target recordset in the center from a table of 1000 rows?

I need it to load a page of items on an ecomm site, but want to provide not 
only the target item, but 100 other choices as well.

The number 100 and 100 are arbitrary.

Basically, pull all records with a price range between .99 and 9.99 with the 
4.99 target row in the center of the resultset. ( and yeah, the example is 
horrible, but it gets the point across)

TIA,

M
--
--
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]<javascript:>
For more options, visit http://groups.google.com/group/houcfug?hl=en

---
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected]<javascript:>.
For more options, visit https://groups.google.com/d/optout.


Confidentiality Notice:

The information contained in this email and any attachments is intended only 
for the recipient[s] listed above and may be privileged and confidential. Any 
dissemination, copying, or use of or reliance upon such information by or to 
anyone other than the recipient[s] listed above is prohibited. If you have 
received this message in error, please notify the sender immediately at the 
email address above and destroy any and all copies of this message.
--
--
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to 
[email protected]<mailto:[email protected]>
For more options, visit http://groups.google.com/group/houcfug?hl=en

---
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to