WEIRD The latest reply by Mags is NOT showing in the thread even after a refresh... THANK YOU MAGS. I can't find the link to the chatgpt, but I got the advice.
So, I think I am almost there. I am having a problem defining the query. It appears that although I had a connection, the connection was not defined, and that was throwing 1 error. This fixed it: .
<?php require_once('Connections/WedingRings.php');
$connection = ('Connections/WedingRings.php') ; ?>
It said to insert this: $WeddingRings = mysqli_query($connection, $query); replacing connection and $query with database calls.
Having defined $connections, that works, but I am lost on the $query. I tried this but it doesn't work:
$queryString_WeddingRings = ("SELECT * FROM CKBauer");
$WeddingRings = mysqli_query($connection, $queryString_WeddingRings);
$WeddingRings = new WA_MySQLi_RS("WeddingRings",$WedingRings,8);
$WeddingRings->setQuery("SELECT * FROM CKBauer");
$WeddingRings->execute();
THE ORIGINAL QUERY STRING IS THIS:
$queryString_WeddingRings = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WeddingRings") == false &&
stristr($param, "totalRows_WeddingRings") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WeddingRings = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WeddingRings = sprintf("&totalRows_WeddingRings=%d%s", $WeddingRings->TotalRows, $queryString_WeddingRings);
?>
THE ERROR I'M NOW GETTING IS THE QUERY STRING, So perhaps I am not initiating the query correctly:
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /usr/www/users/jodenii/cbauer/weddingrings.php on line 27
Warning: mysqli_error() expects parameter 1 to be mysqli, string given in /usr/www/users/jodenii/cbauer/weddingrings.php on line 33
Query failed:
These lines are the Query in bold I tried to set and line 33: if (!$WeddingRings) {
die("Query failed: " . mysqli_error($connection));
}