Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

need help about uploading image to mysql

images php coding issues or problems here.

Moderators: macek, egami, gesf

need help about uploading image to mysql

Postby diplu » Wed Jun 06, 2012 10:14 pm

Hi, I am new to php-mysql,so it will be helpful if anyone help me.I know the normal procedure to upload file to folder,but don't know how to upload the file to mysql server.And another question how to change the image name if two image have the same name to upload ? Thank you...
diplu
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jun 06, 2012 2:43 am

Re: need help about uploading image to mysql

Postby kyle04 » Tue Jul 17, 2012 5:32 am

kyle04
New php-forum User
New php-forum User
 
Posts: 94
Joined: Sat Jul 07, 2012 1:36 pm

Re: need help about uploading image to mysql

Postby Acesystech » Tue Aug 21, 2012 1:08 am

By using the input tag we can upload image to mysql.

<input type="file" name="image" id="file" />


Save the uploaded file .

$image= $_FILES['image']['name'];
$add="upload/".$_FILES['image']['name'];// upload denotes the folder name where the image to be save.
move_uploaded_file ($_FILES['image']['tmp_name'],$add);
Acesystech
New php-forum User
New php-forum User
 
Posts: 35
Joined: Mon Aug 20, 2012 10:27 pm
Location: Ernakulam

Re: need help about uploading image to mysql

Postby janudewangga » Sun Sep 02, 2012 11:41 am

If you want to save the image in your database, it needs very big space. I suggest you to just upload the images into your public folder, and save the URL in the database, I hope it helps. I'm newbie here :)
janudewangga
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Sep 02, 2012 11:28 am
Location: Wonosari, Gunungkidul, Yogyakarta, Indonesia


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.