kernelgpf Posted September 18, 2007 Share Posted September 18, 2007 I switched servers, and as soon as I did, this bit of code doesn't work, it's printing everything out twice. I have PHP 5 on my new server.. $query=mysql_query("select indistrict,acreID,whatisbuilt,ownedby,name from land where ownedby='$vid'"); $num=mysql_num_rows($query); if($num == "0"){ print "No acres!"; include "footer.php"; exit; } while($row=mysql_fetch_array($query)){ if(empty($row[whatisbuilt])){ $row[whatisbuilt]="nothing"; } if($row[whatisbuilt] == "stable"){ print "<a href='stable.php?stableID=$row[acreID]'><b>$row[name]</b> Stable (#$row[acreID])</a> | <a href='acre.php?acreID=$row[acreID]'>[ x acre link ]</a><br>"; continue; } if($row[whatisbuilt] == "cage"){ print "<a href='cage.php?cageID=$row[acreID]'><b>$row[name]</b> Cage (#$row[acreID])</a> | <a href='acre.php?acreID=$row[acreID]'>[ x acre link ]</a><br>"; continue; } if($row[whatisbuilt] == "cave"){ print "<a href='cave.php?caveID=$row[acreID]'><b>$row[name]</b> Cave (#$row[acreID])</a> | <a href='acre.php?acreID=$row[acreID]'>[ x acre link ]</a><br>"; continue; } print "<a href='acre.php?acreID=$row[acreID]'>Acre #$row[acreID]</a> - <b>$row[whatisbuilt]</b> on it - in the <b>$row[indistrict]</b><br>"; } Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted September 18, 2007 Share Posted September 18, 2007 Are you sure you don't have another loop surrounding the while loop? Why do you have all those continues in there? It should do just fine without them. I tested your code on my server, just replaced everything with my DB information and it worked fine. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 18, 2007 Share Posted September 18, 2007 Perhaps you have two entries which meet that query. Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted September 18, 2007 Author Share Posted September 18, 2007 Eh, you're right jesirose. =P When I was copying over my DB I must've done that table twice. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.