Jump to content

Recommended Posts

Hi,

 

I have some code which loops whilst there are some results in the database.  These are displayed inside a while loop. However any div inside the loop does not display.

  <?php
while($row= mysql_fetch_array($result))
{
if ($row['picture'] == "")
{
	$FILENAME = "imageunavailable.png";
}
else
{
	$FILENAME =  $row['picture'];
}
?>


<img src= "pictures/<?php echo ($FILENAME)?>" width = "153" height = "150" border="0">  </div>



<div id="profile2"><?php echo  $row['FIRSTNAME']?> <?php echo  $row['SURNAME']?></div>


<div id="profile2-2">Email 1:   <?php echo $row['email1']?> <br /> Email 2:   <?php echo $row['email2']?> <br /> Mobile:     <?php echo $row['mobilenumber']?></div>



<div id="profile3">About me<span class ="image2"><img src="../graphics/group.gif" align="middle" /></span></div>



<div id="profile3-3"><?php echo  $row['aboutme']?>
</div>
<div id="profile14">Photo</div>


<div id="profile10">Friends<span class ="image6"><img src="../graphics/group.gif" align="middle" /></span></div>

<div id="profile4">Favourite Holiday(s)<span class ="image3"><img src="../graphics/group.gif" align="middle" /></span></div>

<div id="profile11">
  <p>php here for friends  </p>
  </div>
  

<div id="profile4-4"><?php echo  $row['favholidays']?>
</div>





<div id="profile5">Next Holiday:<span class ="image4"><img src="../graphics/group.gif" align="middle" /></span></div>
<div id="profile5-5"><?php echo $row1['resort']?>
</div>




<div id="profile6">Comments<span class ="image5"><img src="../graphics/group.gif" align="middle" /></span></div>
<div id="profile12">Past Holidays<span class ="image7"><img src="../graphics/group.gif" align="middle" /></span></div>


    		<?php } ?>
  <form id="form1" name="form1" method="post" action="">
<div id="profile8">


      <textarea name="textarea" cols="41" rows="4"></textarea>
  </div>
  
  	<div id="profile13">
  <p>
    <?php while($row2= mysql_fetch_array($result2)) 
{
	 echo $row2['resort']; ?> 
    <br>
        <?php
}
?>
    past holidays 
    

  </p>
  </div>

<div id="profile9">


<input type="submit" name="Submit2" value="Post" style="color: white; background-color:#003399" />
  </div>
  <div id="profile7">

    <p>!php for comments here!  </p>
    </div>
    </form>

 

Could anyone see my problem. I have tried ending the loop in many places.

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/53210-while-loop-and-div-problem/
Share on other sites

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.