A small scope issue in PHP, I can't name the $ report variable outside the while loop. I have tried various things, including return . This does not work, the only two functions that work here are if I echo $report variable inside the loop or I print . Which I do not want to do, although it solves the problem, but I do not want random nonsense on the user's screen.
I look around the past 15 minutes and I have not seen any problems like this.
Any help would be appreciated.
<? require "functions2.php"; require "members.php"; $query = "SELECT MAX(DOCid) as prevDOCid from reports"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $prevDOCid = $row[prevDOCid]; $thisDOCid = $prevDOCid+1; $report = "a"."b".$thisDOCid; } echo $report; ?>
Cayetano gonçalves
source share