473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to update image using mysql in php?

in below my code
in this code image is not move in folder but updated the path what are reason?
Expand|Select|Wrap|Line Numbers
  1. if($btnUpdate != "")
  2.     {
  3.      $id = $_POST["id"];
  4.      $uploaddir = './upload/'; 
  5.      $ssImage = $uploaddir.basename($_FILES['image']['name']); 
  6.  
  7.  
  8.  
  9.  
  10.         mysql_query("update gallery set gallery_image='".$ssImage."' where id_gallery = '".$id."' " ) or die(mysql_error());
  11.         if (move_uploaded_file($_FILES['image']['tmp_name'], $ssImage)) {
  12.         header('Location: gallarydetail.php');
  13.      }
  14.     }
Aug 9 '12 #1
1 11141
Dormilich
8,658 Expert Mod 8TB
what are reason?
I would guess that move_uploaded_file() failed.
Aug 10 '12 #2

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

Similar topics

10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
1
by: hemashiki | last post by:
hi i inserted an image in mysql,by using BLOB type i wan to fetch..can anyone tell me,how to do this
4
kaleeswaran
by: kaleeswaran | last post by:
hi! now i am using banking project.so i want to upload an image into mysql data base and j2ee using now. please any one give me the clue to uploade the image. thanks,
1
by: jamal8t2 | last post by:
<?php //$file_dir="/htdocs/upload"; // Connect to database $db_name1="test";// Database name $conn1=mysql_connect("localhost","","") or die("I Couldn't connect"); ...
3
rajiv07
by: rajiv07 | last post by:
Hi to all, We can store image in mysql using MEDIUMBLOG data type.I want to know how to insert or select and store an image data type using perl. Is any idea Please Thanks. Regards ...
2
by: shasia | last post by:
i insert an image into mysql using asp.net.but only null values are stored in the mqsql .i dont know why?
4
by: foss | last post by:
HI all, I am able to upload the image as blob to mysql. but while displaying the image i cant display it properly . The code used for uploading image to mysql inserts data into mysql table.The...
7
by: clarence8816 | last post by:
Hi, i have used this code to save my image directly from the web URL to mysql: $url=http://www.example.com/img.jpg $image = addslashes(fread(fopen($url","rb"),$filesize)); the $image is...
1
by: santhanalakshmi | last post by:
hi, Please tell me ,how to insert an image in mysql ? for example ,my image is in the c drive under the image folder. We can use "BLOB datatype" for storing of ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.