Any help would be greatly appreciated!
Code: Select all
$sql="SELECT * FROM royals";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
while($rows=mysql_fetch_array($result))
{
$id[]=$rows['id'];
echo "".$rows['nickname']." (id=".$rows['id'].") (potentiallength=".$rows['potentiallength'].") (length=".$rows['length'].") <br>";
if ($descript3['lifestage'] < 3)//if age is under adolescent add 1/12th of 40% of the growth left in inches if fed well per month
{
$potentiallength = $rows['potentiallength'];
$growthleft = ($potentiallength-16);
$growth = (($growthleft*.40)/12);
echo "(growth=".$growth. ")";
for($i=0;$i<$count;$i++){
$sql1="UPDATE royals SET length=length+1 WHERE id='$id[$i]'";
$result1=mysql_query($sql1);
}//end for
}