Skip to content
Permalink
Browse files

rawsql bugfix/text adaption

  • Loading branch information...
NB-Core committed Jan 7, 2016
1 parent 411da90 commit 57804ef21a589551da034d4c816b6e34b111442e
Showing with 19 additions and 13 deletions.
  1. +1 −0 CHANGELOG.txt
  2. +18 −13 rawsql.php
@@ -8,6 +8,7 @@ Changes to 1.2.5 +nb
*lib/mail/case_default.php --> javascript security confirmation for move/delete of mail
*lib/pageparts.php --> added ajax script for title change (in case of new mail), needed maillinktabtext() function
*list.php --> new setting (in lib/data/configuration.php) added to show only online folks in list.php on the frontpage (default true). reason: online spiders grabbing playerlists in total makes no sense
*rawsql.php --> small text adaption for when no changes are made. Also removed error text when an UPDATE/DELETE statement produced no affected rows to show (db_num_rows error on TRUE result)
*superuser.php --> new hook to make the section "switchable"
[FIXES]
*lib/commentary.php --> forgot a closing > at a </div> - section close
@@ -28,24 +28,29 @@
} else {
if (db_affected_rows() > 0) {
output("`&%s rows affected.`n`n",db_affected_rows());
} else {
output("No rows have been changed.`n`n");
}
rawoutput("<table cellspacing='1' cellpadding='2' border='0' bgcolor='#999999'>");
$number = db_num_rows($r);
for ($i = 0; $i < $number; $i++) {
$row = db_fetch_assoc($r);
if ($i == 0) {
rawoutput("<tr class='trhead'>");
$keys = array_keys($row);
if ($r!==true) {
// if $r===true, it was an UPDATE or DELETE statement, which obviously has no result lines
$number = db_num_rows($r);
for ($i = 0; $i < $number; $i++) {
$row = db_fetch_assoc($r);
if ($i == 0) {
rawoutput("<tr class='trhead'>");
$keys = array_keys($row);
foreach ($keys as $value) {
rawoutput("<td>$value</td>");
}
rawoutput("</tr>");
}
rawoutput("<tr class='".($i%2==0?"trlight":"trdark")."'>");
foreach ($keys as $value) {
rawoutput("<td>$value</td>");
rawoutput("<td valign='top'>{$row[$value]}</td>");
}
rawoutput("</tr>");
}
rawoutput("<tr class='".($i%2==0?"trlight":"trdark")."'>");
foreach ($keys as $value) {
rawoutput("<td valign='top'>{$row[$value]}</td>");
}
rawoutput("</tr>");
}
rawoutput("</table>");
}
@@ -85,4 +90,4 @@
addnav("", "rawsql.php?op=php");
}
page_footer();
?>
?>

0 comments on commit 57804ef

Please sign in to comment.
You can’t perform that action at this time.