Automatically Creating Div's Using Data From A Sql Table
I'm trying to create duplicate divs with different data in each obtained from a SQL database. I have the code creating the divs and populating the correct fields with the correct d
Solution 1:
Try this :
<?php
$query = mysql_query("SELECT id, name, location, amountRequested FROM fundable");
while ($temp = mysql_fetch_array($query)) {
echo "<div class='widgetLoan'>";
echo "<div class='title'><h6>".$temp['name']."</h6><span class='widgetLoanCat'>Category</span></div>";
echo "<div class='num'><a href='#' class='blueNum'>".$temp['amountRequested']."</a></div>";
echo "</div>";
}
?>
Solution 2:
you forgot to close a </div>
tag
change
echo "<div class='title'><h6>".$temp['name']."</h6><span class='widgetLoanCat'>Category</span>";
for
echo "<div class='title'><h6>".$temp['name']."</h6><span class='widgetLoanCat'>Category</span></div>";
Solution 3:
Looks like you are missing a </div>
tag to me.
Post a Comment for "Automatically Creating Div's Using Data From A Sql Table"