older code and now mysqli
So for years, I did a page to a result page, ie , question = answer using a mysql id... all good.
But I had to relearn with mysqli better code. I am sharing in hopes it helps someone else...
Project in play:
https://classicfieldguns.com/rifles.php
page for results
https://classicfieldguns.com/rifles-results.php?gun_ID=1
or
https://classicfieldguns.com/rifles-results.php?gun_ID=2
So while I had the "idea" of how it worked previously, I didn't quite get it with using new mysqli,
I am sharing but also so I remember how to re-learn this one.
<?php
$rifles = new WA_MySQLi_RS("rifles",$classic2020,0);
$rifles->setQuery("SELECT * FROM guns WHERE cat_ID = 1 ORDER BY gun_ID DESC");
$rifles->execute();
?>
the result page
<?php
$fieldgunresult = new WA_MySQLi_RS("fieldgunresult",$classic2020,1);
$fieldgunresult->setQuery("SELECT * FROM guns WHERE gun_ID = ?");
$fieldgunresult->bindParam("i", "".(isset($_GET['gun_ID'])?$_GET['gun_ID']:"") ."", "-1"); //colname
$fieldgunresult->execute();
?>
I am still testing but I think I have figured it out. It is a lot different than from earlier efforts.