While Statement and Divs
<p>I am trying to get the code below to loop using a while statement. The problem I am having is getting the divs to worth with in the PHP. Any ideas on how I can make this happen? My database consists of a columns called month, day, description, and location.     </p>

<pre><code>&lt;div class="events-module"&gt;

&lt;?php
$con = mysql_connect("localhost","username","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("sandbox", $con);


$result = mysql_query("SELECT * FROM events"); ?&gt;

&lt;?php while($row = mysql_fetch_array($result)) ?&gt;

&lt;div class="date"&gt;
&lt;div id="month"&gt;&lt;h4&gt;&lt;?php echo $row['month']; ?&gt;&lt;/h4&gt;&lt;/div&gt;
&lt;div id="day"&gt;&lt;h3&gt;&lt;?php echo $row['day']; ?&gt;&lt;/h3&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class="event"&gt;
&lt;div id="description"&gt;&lt;p&gt;&lt;?php echo $row['description']; ?&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div id="location"&gt;&lt;p&gt;&lt;b&gt;&lt;?php echo $row['location']; ?&gt;&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;?php endwhile;

 mysql_close($con);

 ?&gt;

&lt;/div&gt;
</code></pre>
