Forum Moderators: coopster
$result=$con->query("SELECT * from `OE_BookmarkLinks` where `Category` = 'PQuicks' order by `Category`, `Name`") or die ("Couldn't retrieve technical links.");
$cnt=0;
$group=set;
if ($myrow=$result->fetch_array()) {
do {
if ($myrow[Category] != $group) {
$group=set;
$group="set"; I'm switching from 5.4 to 7.0
[23-Jan-2020 17:52:14 UTC] PHP Warning: Use of undefined constant set - assumed 'set' (this will throw an Error in a future version of PHP) in /home/elfswor1/public_html/Bookmark/index.php on line 145
I thought for a bit I was setting $group to a specific variable type but I was unable to find anything close.
if ($myrow[Category] != $group) {
This worked faultlessly
$result=$con->query("SELECT * from `OE_BookmarkLinks` where `Category` = 'PQuicks' order by `Category`, `Name`") or die ("Couldn't retrieve PQuick links.");
$cnt=0;
$group=set;
if ($myrow=$result->fetch_array()) {
do {
if ($myrow[Category] != $group) {
if ($cnt > 0) {
echo "</dl>";
}
echo "<h3 style='margin-bottom:4px;'>$myrow[Category]</h3><DL style='margin-top:0;'>";
}
$group=$myrow[Category];
echo "<DD style='margin-left:10px;'><A href='$myrow[URL]' target=_blank>$myrow[Name]</a>";
$cnt++;
} while ($myrow=$result->fetch_array());
echo "</dl>";
}
[edited by: phranque at 12:21 am (utc) on Feb 4, 2020]
[edit reason] splice cleanup [/edit]
$group = 'set'; $Group=set; is where my code is breaking.
if ($myrow[Category] != $group) {
if ($myrow['Category'] != $group) { echo "<h3 style='margin-bottom:4px;'>$myrow[Category]</h3><DL style='margin-top:0;'>";
echo "<h3 style='margin-bottom:4px;'>{$myrow['Category']}</h3><DL style='margin-top:0;'>"; [edited by: w3dk at 7:28 pm (utc) on Feb 3, 2020]