Skip to content

Commit

Permalink
initialize $sRowClass so AlternateRowStyle works
Browse files Browse the repository at this point in the history
  • Loading branch information
DAcodedBEAT committed Sep 21, 2024
1 parent 4ee4d72 commit 693662b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/QuerySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function ExportQueryResults(string $sSQL, &$rsQueryResults)

$sCSVstring .= "\n";

//Loop through the recordsert
//Loop through the recordset
while ($aRow = mysqli_fetch_array($rsQueryResults)) {
//Loop through the fields and write each one
for ($iCount = 0; $iCount < mysqli_num_fields($rsQueryResults); $iCount++) {
Expand Down Expand Up @@ -132,7 +132,7 @@ function RunFreeQuery(string $sSQL, &$rsQueryResults)

echo '</tr>';

//Loop through the recordsert
//Loop through the recordset
while ($aRow = mysqli_fetch_array($rsQueryResults)) {
$sRowClass = AlternateRowStyle($sRowClass);

Expand All @@ -146,7 +146,7 @@ function RunFreeQuery(string $sSQL, &$rsQueryResults)
$aHiddenFormField[] = $aRow[$iCount];
} else { //...otherwise just render the field
//Write the actual value of this row
echo '<td align="center">' . $aRow[$iCount] . '</td>';
echo '<td align="center">' . htmlspecialchars($aRow[$iCount]) . '</td>';
}
}
echo '</tr>';
Expand Down
3 changes: 2 additions & 1 deletion src/QueryView.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ function DoQuery()
<?php
$aAddToCartIDs = [];

$sRowClass = 'RowColorA';
while ($aRow = mysqli_fetch_array($rsQueryResults)) {
// Alternate the background color of the row
$sRowClass = AlternateRowStyle($sRowClass);
Expand All @@ -229,7 +230,7 @@ function DoQuery()
} else {
// ...otherwise just render the field
// Write the actual value of this row
echo '<td>' . $aRow[$iCount] . '</td>';
echo '<td>' . htmlspecialchars($aRow[$iCount]) . '</td>';
}
}

Expand Down

0 comments on commit 693662b

Please sign in to comment.