close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Best Way To Proceed

Thread began 1/06/2022 3:45 am by yogastudents362523 | Last modified 1/13/2022 9:28 am by yogastudents362523 | 15 views | 3 replies


Best Way To Proceed


This is not about an error, so no real need--or urgency to--respond.

I do not like amending code for my needs or purposes, because only being a relatively unfamiliar amateur, it leads to errors. The "while" statement the MySQLi extension placed on my page did not give me enough control over the output. I found that I instead needed a do-while loop. I first had to create my solution procedurally elsewhere, and then gradually adapt to object-oriented.

Here is the solution I came up with:

<?php if ($mySaturdayClasses->TotalRows > 0) { // Show if mysqli recordset not empty ?>
<p><span class="cancelledtext">Classes held on:

$previous = date('M');
echo "<strong>";
echo $previous;
echo "</strong>";
$wa_startindex = $mySaturdayClasses->Index;
do {

if (!(date('M', strtotime($mySaturdayClasses->getColumnVal("classdate"))) == $previous))
echo "<strong>";
echo "| ";
echo date('M', strtotime($mySaturdayClasses->getColumnVal("classdate")));
echo "</strong>";
$previous = date('M', strtotime($mySaturdayClasses->getColumnVal("classdate")));
echo " " . date('jS', strtotime($mySaturdayClasses->getColumnVal("classdate")));
<?php $mySaturdayClasses->moveNext();
} while (!$mySaturdayClasses->atEnd()) ; ?>
<?php $mySaturdayClasses->moveFirst(); //return RS to first record
unset($wa_repeatcount); ?>

<?php } // Show if mysqli recordset not empty ?>

That solution was based on this query (generated by MySQLi):

$mySaturdayClasses = new WA_MySQLi_RS("mySaturdayClasses",$mysqli_workshops,0);
$mySaturdayClasses->setQuery("SELECT * FROM workshops.saturdayssundays WHERE (saturdayssundays.classdate BETWEEN (DATE_ADD(CURDATE(), INTERVAL 0 MONTH)) AND (DATE_ADD(CURDATE(), INTERVAL 5 MONTH))) AND (WEEKDAY(saturdayssundays.classdate)=5) ORDER BY saturdayssundays.classdate");

I just want to know if there was a way to achieve the same end ENTIRELY using WebAssist tools, and that I somehow missed. I have some more complex tasks I must accomplish that will appear later in this project, and if I can avoid hand-coding to minimize my risks, that is what I would prefer.

Thank you,

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





Ease of use


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...