the first code running exactly without any problems, but this code can't give the links of images
could you add image links to this code SLL please?
<?php
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$number_of_news = 5;
$sql = "SELECT i.image_name, i.image_date, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_date DESC
LIMIT $number_of_news";
$result = $site_db->query($sql);
$new_images_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$new_images_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= $number_of_news; $i++) {
if (isset($new_images_list[$i])) {
$image_date = format_date($config['date_format']." ".$config['time_format'],$new_images_list[$i]['image_date']);
$news = ("new image <b>" . $new_images_list[$i]['image_name'] . "</b> in the category <b>" . $new_images_list[$i]['cat_name'] . "</b> uploaded by <b>" . $new_images_list[$i]['user_name'] . "</b> on <b>" . $image_date . "</b><br>" );
echo $news;
}
}
?>