close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Creating coherent and coordinated links between Results and Details pages

Thread began 10/02/2022 5:06 pm by yogastudents362523 | Last modified 10/05/2022 11:24 am by Ray Borduin | 157 views | 5 replies |

yogastudents362523

Creating coherent and coordinated links between Results and Details pages

Dear Ray,

I have had a long struggle with getting a Results-Details pair to work together. Nothing I have tried is working, and I could not find any information in any searches through the Forum.

I did try describing the situation, but it got convoluted, I think it is easier and more effective to see the note on each page, which indicates what I am trying to achieve.

I have also attached the two files.

I would be grateful for whatever hint you can provide as to how to proceed.

Thank you.

Attached Files
presenters_basic.php
presenters_full_info.php
Sign in to reply to this post

yogastudents362523

possible webassist query rewriting bug when using LIMIT and trying to ORDER BY with more than a single field?

Hello,

I have just disocvered that webassist is automatically rewriting my queries, which is now why I believe (but possibly wrongly) that I have been unable to put together my pages and queries.

If I try to use variables to set up the following query with LIMITs in place and so I can control the paging:

<?php $starthighlight = 1;
$numberofhighlights = 4; ?>
<?php
$rsPresenterHighlights = new WA_MySQLi_RS("rsPresenterHighlights",$mysqli_navayogimarga,$numberofhighlights,$starthighlight);
$rsPresenterHighlights->setQuery("SELECT * FROM presenter_data WHERE ID >= 1 ORDER BY `Last`,`First` ASC ");
$rsPresenterHighlights->execute();
?>

then when I run the script, webassist eventually overwrites my original query to:

<?php
$rsPresenterHighlights = new WA_MySQLi_RS("rsPresenterHighlights",$mysqli_navayogimarga,0);
$rsPresenterHighlights->setQuery("SELECT * FROM presenter_data ");
$rsPresenterHighlights->execute();
?>

meaning it ignores my requests. And since the query is of course at the head, it never previously occurred to me to go back and check what was happening.

I have also found that QueryBuilder is failing. It either hangs; or else it tells me that it cannot recognize any of the table or columns, and that these will be deleted. I therefore used some third-party software to build the queries I wanted; which I am now finding webassist will not accept.

I am hopeful that some kind of workaround exists that will allow me to achieve the objectives I have in mind?

I still accept that I am somehow applying a flawed logic, and that that is why the queries are not "sticking", and not allowing me to use the variables I need.

Thank you for your kindness.
KAB

Sign in to reply to this post

Ray BorduinWebAssist

Give me a call tomorrow and I can look into it with you and see if I can figure out how to fix your issues.

Sign in to reply to this post
Did this help? Tips are appreciated...

yogastudents362523

Thank you very much. I will call this afternoon; most likely somewhere around 2:30 pm or just after.

And just in case you can straight away see that I am on the wrong path (very likely!!), then I have developed the following two queries/routines to try to assist me:

(1)
<?php
$rsPageCount = new WA_MySQLi_RS("rsPageCount",$mysqli_navayogimarga,1);
$rsPageCount->setQuery("SELECT COUNT(ID) AS total FROM presenter_data WHERE presenter_data.ID >= 1");
$rsPageCount->execute();
?>

(2)
<?php $results_per_page = 4 ; ?>

<?php $total_pages = ceil(($rsPageCount->getColumnVal("total")) / $results_per_page); ?>

<p><strong>The Presenters appear in the ID order:<br>
<?php $previous = ""; // set my initial field determiner to 0 ?>
<?php
while(!$rsPresentersMenuListing->atEnd()) {
?>
<?php
// if it doesn't match the previous value then display the ID
if ($rsPresentersMenuListing->getColumnVal("ID") != $previous) { ?>
<?php echo $rsPresentersMenuListing->getColumnVal("ID"); ?> |

<?php
} else {
// otherwise, insert this text and non-breaking spaces
echo '&nbsp; move to next &nbsp;';
}

// set $previous variable to current ID value ready for next iteration
$previous = $rsPresentersMenuListing->getColumnVal("ID");
$preceding_record = $rsPresentersMenuListing->getColumnVal("ID");
?>

<?php
$rsPresentersMenuListing->moveNext();
$succeeding_record = $rsPresentersMenuListing->getColumnVal("ID");
}
$rsPresentersMenuListing->moveFirst(); //return RS to first record
?>
</strong></p>

******

And I have then gotten a bit stuck trying to display the following on the Details page. This is mainly because I can't seem to get the Page Link features to work.

Underneath is what I currently have displaying on the page. I am trying to make it possible to navigate record by record, on the Details page, while also always being possible to jump back to whatever page happens to hold that record on the Results page. Since I can't get the Page links to work, then my current work-around is to use the GET. I also can't use the values I tried to set up above of $preceding_record and $succeeding_record:

<h4 style="text-align: center"><a href="">ID = ? </a>I.e. proposed Jump to Previous Record | <a href="">ID = <?php echo $_GET['ID'] ; ?></a> Proposed Jump to Results page, whatever page shows this current record | <a href="">ID = ? </a> Proposed Jump to Next Record | etc.

Thank you,
KAB

Sign in to reply to this post

yogastudents362523

Hello,

Thank you very much.

Just one minor issue.

If the Presenter on the details page is the last in their set of 4 as:
{1, 2, 3, 4},
then when we click on 4 to go back to the Records page, we end up on the page that in fact displays {5, 6, 7, 8}.

This then means that when we are on Record 16, which means the set
(13, 14, 15, 16}
We end up on a page on the Records page that shows no Presenters at all, presumablyh because it is attempting to display
{17, 18, 19, 20},
which do not exist.

So only on the last one in each set are we having a shift rightwards, The other three in each set work just fine.

Thank you

Sign in to reply to this post

yogastudents362523

Hello,

I believe I have fixed it?

I changed your "Index + 1" to just "Index" as follows:

You had:
<a href="presenters_basic.php?pageNum_rsPresentersListing=<?php echo(floor(($rsPresentersMenuListing->Index+1)/4)); ?>">Return to Paged Listing</a>

I changed it to <a href="presenters_basic.php?pageNum_rsPresentersListing=<?php echo(floor(($rsPresentersMenuListing->Index)/4)); ?>">Return to Paged Listing</a>

Everything seems to be working so far.

Thank you again

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...