Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Weird recordset problem

Guest
Apr 21, 2010 Apr 21, 2010

Copy link to clipboard

Copied

I have a weird problem. I made a site with a phpmysql database. i wanted a url variable to alter the data that is fetched, so I did that. my query is created using a sprintf statement, and it all works fine. Small (and weird) problem - some pages may have more than 1 page of results, so i was going to insert a recorset navigation bar. However I can't - there is no recordset showing in the bindings window, even though all my database fetching works fine. I assume this is because my query string is dynamically created. Is there any other simple-ish way to quickly add paging when there is no recordset showing in the bindings?

TOPICS
Server side applications

Views

493
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 21, 2010 Apr 21, 2010

Copy link to clipboard

Copied

copy current code to notepad

change your query to not hold requested id

save and look at the recordset

then do your changes and reapply the section of code that requires your page id

if that does not help save and restart dw and see if recordset comes back up.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 22, 2010 Apr 22, 2010

Copy link to clipboard

Copied

tried both those suggestions and not there yet, but i tried a variation and got a bit of progress.

based on your idea, I created a new document and created the recordset with the hardwired category value. It popped up in bindings as expected. Then, I added a recordset navigation bar to that page. I then copied and pasted that nav bar into the original page. (after all, that is all i am really needing to do - add a navigation bar to my database page, which i can't do thru DW menus if it doesn't see a recordset in the bindings panel).

so anyway, I manually pasted the code for the nav bar into my original page, fired it up.... and this is the functionality i now have, which I don't quite follow:

let's say the call to the database thru the url variable is "cat=11" for category 11. It brings up the first page of category items no problem. The navbar reacts properly, hiding the next button if there aren't more than 5 records for example. BUT, when I click the "next page" button, it brings up a page of the first 5 records of the database, ie records that are not in the recordset.... ?huh? same 5 records pop up no matter what starting category is in there.

is it perhaps that when it goes from page 1 to page 2 it clears the variable value originally passed thru the url? I'm thinking maybe i need to set a session variable that remembers the current category between pages?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 22, 2010 Apr 22, 2010

Copy link to clipboard

Copied

LATEST

fixed it. for reference in case anyone else has the same issue...

i needed to keep re-passing the category variable to successive pages of the recordset. my mistake was in believing that it was one page, with a dynamic recordset which was the only thing changing. in actual fact, every time you click on the "next" button on the navigation bar, it links to a new iteraton of the page. so i just went into the code for the navbar, and at the end of the printf statement, tacked on "&cat=%d" and at the end added $CT as the source for the %d variable. now it works like a charm.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines