PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
Hi guys, bit of a newbie php person here.
In ASP.NET it was possible to display images that were stored as url's in SQL when displaying the grid view (so I don't need to clog the databases with images). Was wondering if it's also possible with PHP.
Currently using this code to display my grid view.
<?php
$connection = mysql_connect("localhost", "USER", "PASSWORD") or die("Error connecting to database");
mysql_select_db("DATABASE", $connection);
$result = mysql_query("SELECT * FROM picture ORDER BY pictureId", $connection) or die("error querying database");
$i = 0;
while($result_ar = mysql_fetch_assoc($result)){
?>
<tr <?php if($i%2 == 1){ echo "class='body2'"; }else{echo "class='body1'";}?>>
<td>
<?php echo $result_ar['picname']; ?></td>
<td>
<?php echo $result_ar['url']; ?>
</td>
<?php
$i+=1;
}
?>
If you guys know a much better way of displaying table data, feel free to add as well
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.