[RESOLVED] SQL image viewer
Posted: Sat Dec 03, 2005 6:55 pm
Jcart | Please use
Processing side:
The form submits correctly and the query advance to the next record but the problems happens when it reloads the browser. Somehow the browser does not get the new field variabled...If you wish to view the actual site its here (http://www.namelesscreations.com/new/work.php)
Any suggestions would great, Jeff McKinney
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am having this problem creating a image viewer that uses a MySQL database
Browser side:Code: Select all
<head>
...
<?php include ("content.php"); ?>
</head>
<body>
...
<td width="420" bgcolor="#E5E5E5" align="center">
<?php
echo "<img src=gallery/$number.jpg>";
echo "<br> $name <br> $created <br> $height x $length x $width";
?>
</td>
<td width="40" bgcolor="#E5E5E5" align="left">
<form action="content.php">
<input type="hidden" name="currentrow" value="<?php echo $counter ?>" />
<input type="submit" name="submit" value=">" />
<input type="submit" name="submit" value="<" />
</form>
</td>
...
</body>Code: Select all
$counter=1;
if($_GET['submit']=='>')
{
$counter = ($_GET['currentrow']+1);
}
elseif($_GET['submit']=='<')
{
$counter = $_GET['currentrow']-1;
}
$query="select * from gallery where number=$counter";
$result = mysql_query($query);
$r=mysql_fetch_array($result);
$number=$r["number"];
$name=$r["name"];
$created=$r["created"];
$height=$r["height"];
$length=$r["length"];
$width=$r["width"];
$type=$r["type"];
header("location:work.php");Any suggestions would great, Jeff McKinney
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]