• Wednesday , 20 September 2017

PHP Tutorials Uploading Storing an Image inside a MySQL Database Part 1 YouTube

Code Canyon

Original source

3d Ocean

Related Posts

27 Comments

  1. Mazgour Aziz
    August 15, 2017 at 04:18

    Download valide source code: http://atominik.com/2J4s

  2. MKO Hartyunyan
    August 15, 2017 at 04:18

    Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in H:3338.5root333register.php on line 5

    Notice: Undefined index: file in H:3338.5root333register.php on line 8

    Notice: Undefined variable: name in H:3338.5root333register.php on line 9

    Notice: Undefined variable: name in H:3338.5root333register.php on line 10

  3. Playerlist
    August 15, 2017 at 04:18

    Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 32

    Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 33

    Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 34
    Thats not an image.

    <?php
    // connect to database
    mysql_connect("localhost","root","") or die(mysql_error());
    mysql_select_db("db_kv_5d") or die(mysql_error());

    //file properties
    if(isset($_FILES['image'])){
    $file = $_FILES['image']['tmp_name'];
    }

    if (!isset($file))
    echo "Please select an image.";
    else
    {
    $image = addcslashes(file_get_contents($_FILES['image']['tmp_name']));
    $image_name = addcslashes($_FILES['image']['name']);
    $image_size = addcslashes(getimagesize($_FILES['image']['tmp_name']));

    if ($image_size==FALSE)
    echo "Thats not an image.";
    else
    {

    }
    }
    ?>

  4. Naveen Rohana
    August 15, 2017 at 04:18

    what is the file extension you used to store this code?

  5. Leonardo monroy
    August 15, 2017 at 04:18

    subi ese hp codigo yaaaaaaa malparido gringo de la mierda subilo yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  6. Soumik Nath
    August 15, 2017 at 04:18

    I have coded both the php files with exactly the same code described in the tutorial
    but the problem is the images are getting stored properly in the mysql database but
    not getting displayed at the web browser while retrieving it from the database Please help.

  7. julmar degojas
    August 15, 2017 at 04:18

    alex garette?

  8. Mohd Asyraaf Syahmi
    August 15, 2017 at 04:18

    any source codes?

  9. Benedict Chin
    August 15, 2017 at 04:18

    Thanks. Nice to know that tmp_name is the path of the image. That solved my problem entirely.

  10. Iktou Sama
    August 15, 2017 at 04:18

    Anyone can help me in this?

  11. T Lokesh
    August 15, 2017 at 04:18

    how to upload multiple images at a time using different blobs and in a single row

  12. trynax chatterje
    August 15, 2017 at 04:18

    Notice: Undefined index: image in C:xampphtdocspracuploadindex.php
    Help please. I viewed the comments but it seems nobody can solve this problem.

  13. Hussain Wali
    August 15, 2017 at 04:18

    BEWARE people if you upload a large image and try to echo the tmp directory, it won't show it

  14. Ahmed Essam
    August 15, 2017 at 04:18

    now i can use mysqli_real_escape_string() instead of addslashes() right?

  15. Matthew Van der Bijl
    August 15, 2017 at 04:18

    Is the source available any where?

  16. ThePakuci
    August 15, 2017 at 04:18

    i've been following this tutorial
    the problem is : Notice: Undefined index: image
    how to solve this problem? anyone?

  17. Can Aykul
    August 15, 2017 at 04:18

    Hey! Cool tutorial!
    But I have a question;
    If I want to upload more than 1MB than it gives me a connection error. I arranged the "my.ini" and "php.ini" files as stackoverflow says.
    But right now it does not give me connection error as before but simply says; "Problem uploading image."
    I don't understand why the query does not work? 🙁
    Please help!

  18. Camille Tiongson
    August 15, 2017 at 04:18

    mine go to if(!isset($file)) even though i selected a file 🙁

  19. Nasser Saadi
    August 15, 2017 at 04:18

    VERY CLEAR AND SMART EXPLAIN
    THANKS A LOT

  20. kamal jung swar
    August 15, 2017 at 04:18

    my this code is not working i did same as what u did 

       <html>
       <head>
       <title>upload</title>
       </head>
       <body>
       
        <form action='uploadd.php' method='POST' enctype='multipart/form-data' ></br>
                File: <input type="file" name= "image" >
                <input type="button" value="upload">
        </form>
        
        <?php
    include("connect.php");

    $file = $_FILES['image']['tmp_name'];

    if(!isset($file))
    echo "Please select image";
    else
    {
    $image = $_FILES['image']['tmp_name'];
    $image_name=$_FILES['image']['name'];
    $image_size=getimagesize($_FILES['image']['tmp_name']);

    if($image_size==FALSE)
    echo "this is not image";
    else {
    }
    }
       ?>
        </body>
        </html>

  21. Teas Ariyanto
    August 15, 2017 at 04:18

    how upload image for different profile .. such as for profile picture ..

  22. Talha Khalid
    August 15, 2017 at 04:18

    ???

  23. Talha Khalid
    August 15, 2017 at 04:18

    Hi My only problem is that uploader code ie from which you upload picture and it came down can you help me!! ???

  24. MOTOBACS
    August 15, 2017 at 04:18

    if (isset($_FILES['image'])) {
            $file = $_FILES['image']['tmp_name'];
    THIS IS WORKING NOW BUT 
    $image = file_get_contents($_FILES['image']['tmp_name']);
    NOT WORKING

  25. MOTOBACS
    August 15, 2017 at 04:18

    i got a error :
    Notice: Undefined index: image in C:xampphtdocshtdocsvehicledbindex.php on line 18

  26. Bob Ghodsi
    August 15, 2017 at 04:18

    Alex:
    Would you let me know how to increase size of jpeg files that I am storing in mysql table

    Thanks.

    Bob Ghodsi

  27. CHARIZARD TAN
    August 15, 2017 at 04:18

    PLEASE HELP!!!!!!!!

    My php got error when i add 
     $file = $_FILES['image']['tmp_name']; to my php.

    i think it got to do with  "<input type="file" name="image">"  at the beginning at the <body> tag

     This is my error – PHP Notice:  Undefined index: image in C:wwwslideshowuploadimage.php

Leave A Comment

You must be logged in to post a comment.