הקוד:
PHP קוד:
<?php
$dbhost = "localhost";
$dbuser = "*****";
$dbpass = "******";
$dbname = "******";
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
mysql_select_db($dbname);
$res = mysql_query('SELECT `id`, `FName` FROM `reka` LIMIT 0, 16');
$all_array = array();
while ($img_data = mysql_fetch_array($res))
{
$all_array[] = $img_data;
}
$num_of_images = mysql_num_rows($res);
echo "<table>
<tr>";
for($x=1; $x<=$num_of_images; $x++)
{
echo "<td><a href='files/".$all_array[$x]['FName']."' title=''>
<img src='files/".$all_array[$x]['FName']."' title='' width='129px' height='96px' style='border: none;' ></a></td>";
if($x % 4 == 0)
{
echo "</tr><tr>";
}
}
echo "</tr></table>";
?>
עדיין אותה בעיה