By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

how to copy a row from a table'tipuranibasti'(one field is blob type)to'puranibasti'

P: 1
in my code all field are copied from tipuranibasti to puaranibasti except image(blob one).in table puranibasti it($image field) shows entry as [BLOB - 0B]

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include ("connect.php");
  3. $id=@addslashes($_GET['id']);
  4. $image=@mysql_query("select * from tipuranibasti where  id = $id");
  5. $image_row=@mysql_fetch_assoc($image);
  6.  
  7.    $name=@$image_row['name'];
  8.    $date=@$image_row['date']; 
  9.    $msg=@$image_row['msg'];
  10.    $image=addslashes(@file_get_contents($image_row['image']));
  11.  
  12.  
  13. if(@mysql_query("insert into puranibasti values('','$name','$date','$msg','$image')"))
  14. {
  15.     echo "image has been inserted successfully";
  16. } else
  17.  {
  18.  echo "problem inserting the image";
  19.  }
  20. ?>
  21.  
Dec 25 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.