Maybe I need to approach it differently. I need to use to variables to open several related pages. One variable for some another variable for others, but always coming back to the first page.
This code opens the following page and sends the ID to it.
<a href="PORC_edit_submission.php?ID=<?php echo ($rsOneSpecies->getColumnVal("ID")); ?>"><?php echo($rsOneSpecies->getColumnVal("ID")); ?></a>
I want to store that ID to a SESSION Variable named “record_ID”
So on the PORC_edit_submission.php page I put this code.
<?php
if (isset($_GET['ID'])) {
@session_start();
$_SESSION["record_ID"] = $_GET['ID'];
@session_commit();
} else if (isset($_SESSION['record_ID'])) {
$_GET["ID"] = $_SESSION['record_ID'];
}
?>
Is that code correct?
Also ,when that page opens (PORC_edit_submission.php), I want to store the record_number in a SESSION Variable (record_number) so I can use it for opening related pages (Some pages will open using record_ID and other record_number).
I want to get the record_number from this recordset.
<?php
$rsRecords = new WA_MySQLi_RS("rsRecords",$siteguide2018,0);
$rsRecords->setQuery("SELECT * FROM PORC_records, aou_list WHERE ID = ? AND PORC_records.species_number = aou_list.SPNO");
$rsRecords->bindParam("i", "".(isset($_GET['ID'])?$_GET['ID']:"") ."", "-1"); //colname
$rsRecords->execute();
?>
What is the code for that?
Or am I going about this all wrong?