Problem with while loop

From: Date: Thu, 08 Jan 2004 05:02:50 +0000
Subject: Problem with while loop
Groups: php.general 
Request: Send a blank email to php-general+get-174029@lists.php.net to get a copy of this message
I can't seam to get this while loop to work properly. It should create a message that has the first two lines and then it will list all the domain that meat the criteria. $lines = "The following are web sites that are at 95% usage or more of there web space\n"; $lines = "Site Name Used(MB) Free(MB) Allowed(MB) \n"; $result=mysql_query("SELECT * FROM domplans"); while($row = mysql_fetch_array($result)){ $dom=$row["domname"]; $total=$row["quota"]; $result1=mysql_query("SELECT * FROM datasubused where domname = '$dom'"); $proccess = mysql_fetch_array($result1); $totalused=$proccess["quotaused"]; $totalfree=$total - $totalused; $percent = ceil(100*$totalused/$total); If($percent>="95"){ $lines = "$dom $totalused $totalfree $total \n"; for( $i=0;$i<count($lines);$i++) { $message .=$lines[$i]; } } echo $message; }

« previous php.general (#174029) next »