tags:

views:

35

answers:

1

Hi , I am using library to upload multiple images in php .This library use flash file and a php file . All things are working but problem is that I want to run a query after each image is uploaded to store image detail in database . If i write query in php file after uploading code then It upload images but no error given and no image details are put in database.

Can any one help me that how I add image details in database after uploading image using flash uploader This is my code

<?
 extract($_GET);

 $filename = $_FILES['Filedata']['name'];
 $temp_name = $_FILES['Filedata']['tmp_name'];
 $error  = $_FILES['Filedata']['error'];
 $size  = $_FILES['Filedata']['size'];

 /* NOTE: Some server setups might need you to use an absolute path to your "dropbox" folder
 (as opposed to the relative one I've used below).  Check your server configuration to get
 the absolute path to your web directory*/


 if(!$error){

  copy($temp_name, '../dropbox/'.$filename);
  $news_query="insert into tbl_news(img_id,headline,caption,news_catgory_id,shooting_date) Values('0000','News_Headline','News_Caption',
  'New_Category','now()')";
  mysql_query($news_query) or die(mysql_error()); 
}
?>

all code working but query data is not updated in database

A: 

May be it's a sql error...if your "shooting_date" field is numeric or date, you can't set it's value like this: 'now()', you must strip the quotes.

arnaldex