Did that and this works...
// Connect to database
include('db_connect.php');
// set variable for link
$id = $_GET['id2'];
//$value = NOW();
//echo '<br />'.$value.'<br /><br />';
// perform query
$query = "SELECT name, type, size FROM simple_tbl ".
"WHERE id = '$id'";
$result = mysql_query($query) or die(mysql_error());
list($name, $type, $size) = mysql_fetch_array($result);
$num_results = mysql_num_rows($result);
if ($num_results > 0)
{
while($file = mysql_fetch_array($result))
{
// filepath
$uploaddir = 'admin/uploads/images/';
$uploadfile = $uploaddir . basename($file['name']);
echo 'Filename ('.$uploadfile.') '.$file['name'].'....<br />';
}
I have now run into a problem where these images need to be archived. Hence my need to store in database table.
Is there any way around this? I have a date field in the table that records when image uploaded.
The image will always have the same name so it overwrites the original in the server folder always.
Any ideas??
thanks.