hi i have a working script to view all images on the database but i now what to sort by username and image_time...
in stead of displaying the images it will display the discription a user type in.. when clicking on the discription it will show all the images from that user and tat date it was uploade...
the follwoing are my two. if some one can help..
in my database i have the following fields.
id auto
username tex
title
discreption
ext
image_time
date
my to php codes are:
this is image.php
<?php
error_reporting(E_ALL);
if(isset($GET['id']) && is_numeric($GET['id'])) {
$link = include ("run.php");
mysql_select_db("dbnation") or die(mysql_error());
$sql = "SELECT data FROM ae_gallery WHERE id={$_GET['id']}";
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
header("Content-type: image/jpeg");
echo mysql_result($result, 0);
mysql_close($link);
}else{
echo 'Please use a real id number';
}
?>
thsi view.php
<?php
include("header.php");
error_reporting(E_ALL);
include ("dbconfig.php");
mysql_select_db("dbnation") or die(mysql_error());
$sql = "SELECT id,title,image_time FROM ae_gallery";
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
while($row=mysql_fetch_assoc($result)){
echo "<table align=center>";
echo "<br>";
echo "<tb>"; print "".$row['title'];
echo "<br>";
echo "<tb>"; print "".$row['image_time'];
echo "<br>";
echo "<tb>"; print '<img src="image.php?id='.$row['id'].'"/>';
}
echo "</ table>";
?>
Thanks in advance.