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...
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);
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