2

i have this code in php. i want my images displayed to be horizontally displayed. those images are saved in xampp. can anybody help me? this is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("dbLetters");
$res=mysql_query("select * from tbLetters");
echo "<table>";
while ($row = mysql_fetch_array($res))
{
echo "<tr>";
echo "<td>";?> <img src = "<?php echo $row["images"]; ?>"  height="200" width="200"> <? php echo "</td>";
echo "</tr>";

}
echo "</table>";
?>

</body>
</html>

your response will be a big help. thanks. :))
user2217076
  • 27
  • 1
  • 4
  • its a pure html issue, don't put then in separate table rows –  Mar 27 '13 at 19:14
  • 1
    **You shouldn't use `mysql_*` functions in new code** ([why?](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php)), they are [deprecated](https://wiki.php.net/rfc/mysql_deprecation). Use [PDO or MySQLi](http://php.net/manual/en/mysqlinfo.api.choosing.php) instead. Also what exactly is your question? How to output your images? Then put all of them in one `` – kero Mar 27 '13 at 19:15
  • http://stackoverflow.com/questions/4550013/html-element-display-in-horizontal-line – ethrbunny Mar 27 '13 at 19:19

1 Answers1

0

Unless you use a data url, you actually need to set up a separate script to pull that will provide the image to the browser.

This will make your image url something like image.php?id=<image_id>. The image.php script will fetch the image and provide the image to the browser.

Its not usually a good idea to store image data in mysql.

datasage
  • 19,153
  • 2
  • 48
  • 54
  • those image has their own specific assignment so i have to put them in the database. any idea how will i arrange them? or is it not possible? – user2217076 Mar 27 '13 at 19:50