Jump to content

Problem with array database insertion


johne90

Recommended Posts

I am trying to get my upload script for fancyupload to insert file names and sizes into my database, but I have only been able to insert the first file in the queue.

 

The data is organized like this:

$result = array();

$result['time'] = date('r');
$result['addr'] = substr_replace(gethostbyaddr($_SERVER['REMOTE_ADDR']), '******', 0, 6);
$result['agent'] = $_SERVER['HTTP_USER_AGENT'];

if (count($_GET)) {
$result['get'] = $_GET;
}
if (count($_POST)) {
$result['post'] = $_POST;
}
if (count($_FILES)) {
$result['files'] = $_FILES;
}

 

I am trying to insert like this:

$insert = "INSERT INTO images VALUES ('$id', '$title', '".$id."_".$title."', '".$_FILES["Filedata"]["name"]."', '".$_FILES['Filedata']['size']."', '', '', '0', '$timeadded')";
$runit = mysql_query($insert) or die("error");

 

Can someone tell me how to get each file to insert?

Link to comment
https://forums.phpfreaks.com/topic/184104-problem-with-array-database-insertion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.