Jump to content

[SOLVED] Server switch- "continue" not working?


Recommended Posts

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>";
}

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.