View Full Version : Generating a full size image from a database

04-09-2006, 07:08 PM
Hey All,

I have a gallery that draws on information in a MySQL db. Everything so far is working just greta but i have a bit of a problem getting the full size image available for people to view. I have two images one 250px wide and the other is 750 px (thumb, fullsize) I have the thumb appearing on page load but I want the visitor to be able to view the full size is they wish. Here is the code for the auto-generated page.... My Database has 7 fields including one Primary_key field.

<?php require_once('../Connections/tpps.php'); ?>
$maxRows_rsNauticals = 10;
$pageNum_rsNauticals = 0;
if (isset($_GET['pageNum_rsNauticals'])) {
$pageNum_rsNauticals = $_GET['pageNum_rsNauticals'];
$startRow_rsNauticals = $pageNum_rsNauticals * $maxRows_rsNauticals;

mysql_select_db($database_tpps, $tpps);
$query_rsNauticals = "SELECT * FROM tpps_pics WHERE category = 'nauticals'";
$query_limit_rsNauticals = sprintf("%s LIMIT %d, %d", $query_rsNauticals, $startRow_rsNauticals, $maxRows_rsNauticals);
$rsNauticals = mysql_query($query_limit_rsNauticals, $tpps) or die(mysql_error());
$row_rsNauticals = mysql_fetch_assoc($rsNauticals);

if (isset($_GET['totalRows_rsNauticals'])) {
$totalRows_rsNauticals = $_GET['totalRows_rsNauticals'];
} else {
$all_rsNauticals = mysql_query($query_rsNauticals);
$totalRows_rsNauticals = mysql_num_rows($all_rsNauticals);
$totalPages_rsNauticals = ceil($totalRows_rsNauticals/$maxRows_rsNauticals)-1;

And here is the "code" i have tried for the new full size page.

<?php require_once('../Connections/tpps.php'); ?>
mysql_select_db($database_tpps, $tpps);
$query_rsNauticalfull = "SELECT primary_key, title, category, fullsize, `desc` FROM tpps_pics WHERE category = ''nauticals';
$rsNauticalfull = mysql_query($query_rsNauticalfull, $tpps) or die(mysql_error());
$row_rsNauticalfull = mysql_fetch_assoc($rsNauticalfull);
$totalRows_rsNauticalfull = mysql_num_rows($rsNauticalfull);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

/picgallery/<?php echo $row_rsNauticalfull['fullsize']; ?>
<?php echo $row_rsNauticalfull['primary_key']; ?>

04-10-2006, 08:17 AM
echo this var ....


check to see if contains anything

04-10-2006, 01:03 PM
It contains the appropriate info but i need it to carry the primary key over so it displays the appropriate full size image. Any ideas?

04-10-2006, 01:23 PM
post what it contains

04-12-2006, 04:37 PM
I got it figured out...

Click here for Full Size (/picgallery/<?php echo $row_rsNauticals['fullsize']; ?>)</p>

04-13-2006, 07:27 AM

your learning quickly