This script broke with php7 having to do with global variables. The gist is: if there is an ID number, query and give the details. If there is no ID number, query and print the appropriate list. My script prints the list, and produces the correct URL, but never runs the top half of the script.
How does one get the variable from the PHP_SELF at the bottom to query at the top of the page .
<?
if ($idr)
{
$photo_result = mysqli_query($db,"SELECT id, photos FROM TABLE WHERE id=$idr");
}
else
{
$result = mysqli_query($db,"
if($r = mysqli_fetch_array($result))
{do
{
printf("<a href=\"%s?idr=%s\">%s</a><br>\n", $PHP_SELF, $r["ID"], $r["ID"]);
}
while ($r = mysqli_fetch_array($result));
}
else
{
echo "Sorry, no dice! ";
}
}
?>
Thanks in advance for any suggestions.
Sincerely
R