need help on display database results correct on pages

this is an example of the actual output on the page:

image.jpg title description date
image.jpg title description date
image.jpg title description date

BUT, how do you:

show the actual image (not the ‘image.jpg’ text) with the description and date under it.
like at this site: rapbasement.com/videos/
(exactly the way they have 3 per column, 3 per row, except I want the date under each title)


the dataset table:

<?php do { ?> <?php } while ($row_recentvideos = mysql_fetch_assoc($recentvideos)); ?>
<?php echo $row_recentvideos['image']; ?> <?php echo $row_recentvideos['title']; ?> <?php echo $row_recentvideos['dateAdded']; ?>

the actual php:

<?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_recentvideos = 60; $pageNum_recentvideos = 0; if (isset($_GET['pageNum_recentvideos'])) { $pageNum_recentvideos = $_GET['pageNum_recentvideos']; } $startRow_recentvideos = $pageNum_recentvideos * $maxRows_recentvideos; mysql_select_db($database_recentVideos, $recentVideos); $query_recentvideos = "SELECT id, dateAdded, title, image, video FROM videos"; $query_limit_recentvideos = sprintf("%s LIMIT %d, %d", $query_recentvideos, $startRow_recentvideos, $maxRows_recentvideos); $recentvideos = mysql_query($query_limit_recentvideos, $recentVideos) or die(mysql_error()); $row_recentvideos = mysql_fetch_assoc($recentvideos); if (isset($_GET['totalRows_recentvideos'])) { $totalRows_recentvideos = $_GET['totalRows_recentvideos']; } else { $all_recentvideos = mysql_query($query_recentvideos); $totalRows_recentvideos = mysql_num_rows($all_recentvideos); } $queryString_recentvideos = sprintf("&totalRows_recentvideos=%d%s", $totalRows_recentvideos, $queryString_recentvideos); ?>

[php]

<?php do { ?>
<tr>
  <td>
         <img src="<?php echo $row_recentvideos['image']; ?>">
  </td>
  <td><?php echo $row_recentvideos['title']; ?></td>
  <td><?php echo $row_recentvideos['dateAdded']; ?></td>
</tr>
<?php } while ($row_recentvideos = mysql_fetch_assoc($recentvideos)); ?>
[/php]

If you need to add a path, do it this way:
[php]

<?php do { ?>
<tr>
  <td>
         <img src="images/<?php echo $row_recentvideos['image']; ?>">
  </td>
  <td><?php echo $row_recentvideos['title']; ?></td>
  <td><?php echo $row_recentvideos['dateAdded']; ?></td>
</tr>
<?php } while ($row_recentvideos = mysql_fetch_assoc($recentvideos)); ?>
[/php]

or you can do it this way:
[php] <img src="<?php
$path = “images/”
echo $path . $row_recentvideos[‘image’]; ?>">[/php]

that partially helped…but I would really like it to display three images per row, with the title and date under the image rather than on the side of the image.

Take a look at this post. http://www.phphelp.com/forum/index.php/topic,9056.msg34968.html#msg34968

Sponsor our Newsletter | Privacy Policy | Terms of Service