please can you help (simple code)
Hello,
I had been very much relying on re-using some old code from my previous project, but things have changed massively.
Here is the MySQL query code as built by DataAssist MySQLi extension.
The "Test" button in the extension says the query is valid. I am selecting all classes for the current month plus 4 ahead.
Since I am not sure if the issue is in my Select query or in the PHP, it is difficult to know what to do next.
<?php
$mySaturdayClasses = new WA_MySQLi_RS("mySaturdayClasses",$mysqli_workshops,1);
$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");
$mySaturdayClasses->execute();
?>
Then I try to create a simple while loop to print out the data. I gave up using the object approach when I couldn't get that to work. But this procedural approach is also not working.
while ($row = mysqli_fetch_array($mySaturdayClasses)) {
echo date('F', strtotime($row["classdate"])) ;
echo date('j', strtotime($row["classdate"])) ;
}
The last time I did all this PHP 5 was only about a year old, and was the exciting new thing.
I would very much appreciate a working example of an object approach so I can figure out what I am doing wrong, and then correct all my other coding that does not seem to be working under PHP 7. I believe PHP 8 is just about upon us!!
Thank you for your help once again,
KAB