Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialize $sRowClass so AlternateRowStyle works #7158

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading