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


Original source


27 responses to “PHP Tutorials Uploading Storing an Image inside a MySQL Database Part 1 YouTube”

  1. 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

  2. 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
    {

    }
    }
    ?>

  3. 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.

  4. 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!

  5. 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>

  6. 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 Reply