How to Fetch / Display an IMAGE from DataBase using PHP Mysql

Sdílet
Vložit
  • čas přidán 14. 10. 2024

Komentáře • 92

  • @migdhaam821
    @migdhaam821 Před 4 lety +7

    For those of you getting the error "mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool "
    for the connection & while loop you can try the following line of codes
    $conn = mysqli_connect("localhost", "root", "", "db_name");
    $sql = "SELECT * FROM table_name";
    $result = mysqli_query($conn, $sql);
    while($row = mysqli_fetch_array($result))
    It worked for me. hope it works for you guys as well.

  • @freddiegrandyanc5818
    @freddiegrandyanc5818 Před 2 lety

    Much helpful bro, 9 hours on just a from i couldn't pull through but your video help, now am going to sleep.

  • @creativeyes3292
    @creativeyes3292 Před 2 lety

    My go to channel for php thanks for sharing your knowledge

  • @vishaljagdhane762
    @vishaljagdhane762 Před 3 lety

    Thanks Sir I Total Opretion Lern For You Are You Tube Channel Thanks Best Of Luck

  • @jesuscuadro228
    @jesuscuadro228 Před rokem +1

    Thanks brother, this content is pure gold. You help me so much :)

  • @samarthbharadwaj6213
    @samarthbharadwaj6213 Před rokem

    Thanks a lot, even ChatGPT didnt know how to solve this, u showed it correctly lol

  • @jeankaleb
    @jeankaleb Před 2 lety +5

    Nice video. But I already know how to do that. It is relatively easy. But what I care to know is. Once you have retrieved the images from the database table and displayed it on a screen. How can you make each image clickable so that only the data from the table where the image is stored is displayed.

    • @isaacmuteru4494
      @isaacmuteru4494 Před 2 lety

      Hello did you find the solution am also looking for this ... Can we connect via WhatsApp?

  • @kawaiimonster2980
    @kawaiimonster2980 Před 4 měsíci

    Thank you very much you saved me

  • @michaelmathew3802
    @michaelmathew3802 Před 2 lety +3

    Thank you bro. You're a life saver 😂🙌

  • @mangoz7929
    @mangoz7929 Před 3 lety +2

    hi is it possible for you to make a tutorial on how to download these files aswell with their original file extension because i realized all we need to do is figure out how to change the extension on download

  • @petra_bunic
    @petra_bunic Před rokem

    Can i insert the code for audio files the same way?

  • @coderyg9257
    @coderyg9257 Před 2 lety

    Thank You , Solved my PROBLEM ☺

  • @nadafarahamrouche9860
    @nadafarahamrouche9860 Před 3 lety +2

    Hello, can you please show us how to zoom-in the picture (took from the data-base) in another page using a link ()

  • @StephanPetrowitsch
    @StephanPetrowitsch Před 4 lety +8

    image is not showing, what can be the reason? My code is: echo '';

    • @shaikhnabeel6443
      @shaikhnabeel6443 Před 3 lety

      how did you solve this error?

    • @StephanPetrowitsch
      @StephanPetrowitsch Před 3 lety +2

      @@shaikhnabeel6443 $typ = "jpeg";
      $bildname = $row['bildurl'];
      if (strcmp( strtolower( substr($bildname, strlen($bildname) - 4)), ".jpg") == 0) { $typ = "jpeg"; }
      if (strcmp( strtolower( substr($bildname, strlen($bildname) - 4)), ".png") == 0) { $typ = "png"; }
      if (strcmp( strtolower( substr($bildname, strlen($bildname) - 4)), ".tif") == 0) { $typ = "tif"; }
      if (strcmp( strtolower( substr($bildname, strlen($bildname) - 4)), ".bmp") == 0) { $typ = "bmp"; }
      try {
      $imagick = new Imagick();
      $imageblob = $row2['file'];
      $imagick->readImageBlob( $imageblob );
      //$imagick_properties = $imagick->getImageProperties('*', FALSE);
      $height = $imagick->getImageHeight();
      $width = $imagick->getImageWidth();

      if ($width > 400) {
      $factor = 400 / $width;
      $height = $height * $factor;
      $width = 400;
      }
      echo '';
      echo $bilddaten . "";
      } catch (Exception $e) {
      }

    • @shaikhnabeel6443
      @shaikhnabeel6443 Před 3 lety

      @@StephanPetrowitsch thanx bro i solved it.

  • @oyalidhasantopu8173
    @oyalidhasantopu8173 Před rokem

    Onek vlo🙂

  • @nonopanzu1193
    @nonopanzu1193 Před rokem

    Between MySQLI and PDO which one is best? 🤦‍♂

  • @KashifAli-tf4rc
    @KashifAli-tf4rc Před 5 lety +1

    Dear, have you accounts software for school or university?

  • @rufatabbasov
    @rufatabbasov Před rokem

    Thank you. It worked!

  • @absalomojiem3404
    @absalomojiem3404 Před 4 lety +1

    Awesome it works. What about inserting?

  • @NiltonOliv
    @NiltonOliv Před rokem

    I made this example, but as I have many records in the database with photos, it doesn't work. It gives the error "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2893560 bytes)".

  • @nitish1379
    @nitish1379 Před 4 lety +2

    Parse error: syntax error, unexpected end of file in C:\wamp64\www\g\displayimage.php showing last line

  • @TECLOVENIA
    @TECLOVENIA Před 4 lety

    Bro, I'm your subscriber. Now I need your help to retrieve the same content procedure using search. I mean to say it should be able to retrieve like students marksheet with photo. Thank you in anticipation.

  • @jackywan6829
    @jackywan6829 Před rokem

    followed your steps to fetch images from the database but the image cannot be displayed, the image is broken, why?

  • @rushikeshraut4618
    @rushikeshraut4618 Před 4 lety +3

    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs ye error aa raha he sir plz help

    • @rtxcomet3681
      @rtxcomet3681 Před 4 lety

      If ke aandar dalo aur $result saath mysqli_num pass karo

    • @mikethebiker555
      @mikethebiker555 Před 3 lety

      @@rtxcomet3681 bro pls tell the format

  • @fanibulmau820
    @fanibulmau820 Před rokem

    frumos!

  • @sanzidasohana1754
    @sanzidasohana1754 Před rokem

    Nice

  • @aditikhandagale5551
    @aditikhandagale5551 Před 3 lety

    Is it possible to save image in database by entering path in php??

    • @fundaofwebit
      @fundaofwebit  Před 3 lety

      Here, it is for image upload with saving path in database.
      czcams.com/video/7S42lpImZ4s/video.html

  • @opticalfiber661
    @opticalfiber661 Před 2 lety +1

    how can i update image from mysql using php ?

  • @precillajansirani6933
    @precillajansirani6933 Před 3 lety

    Hi Sir, Im just getting the alt value only... No image is displaying

    • @ajaysadhu8437
      @ajaysadhu8437 Před 2 lety

      keep img save into the same folder as where your file

  • @katrinahew4246
    @katrinahew4246 Před 2 lety +2

    why don't you just post a link for us to download the code?

  • @hdpaintcode
    @hdpaintcode Před 3 lety

    If you post it to the web, can people see your database password when they check the page source?

    • @god_rex579
      @god_rex579 Před 3 lety +1

      People will not be able to see what's written in the PHP code because all the php the code get hidden

  • @omarykijogoo9216
    @omarykijogoo9216 Před 4 lety

    how ican create search bar which my search artist videos from the database using php and mysqli

  • @Dojo2000
    @Dojo2000 Před 6 měsíci

    thanksss uuuuu !!!

  • @kadirgodil1307
    @kadirgodil1307 Před 4 lety +1

    image isnt displaying else all other data is dislayed plss help

  • @sanadara95
    @sanadara95 Před rokem

    Thank You

  • @sofiyaabrar3783
    @sofiyaabrar3783 Před 4 lety +5

    Image is not shown ...instead of it cross mark over is shown 😑

    • @jackywan6829
      @jackywan6829 Před rokem

      i have the same problem. did you solve it?

  • @collinsonyegbado309
    @collinsonyegbado309 Před 4 lety

    Its a nice video. Can you a code to print it in pdf?

  • @Woril
    @Woril Před 2 lety

    Thank you bro!

  • @ntc1276
    @ntc1276 Před rokem

    Why is only half of my picture coming out? pls😭😭

  • @mathewdalisay6529
    @mathewdalisay6529 Před 3 lety

    Thank you so much bro

  • @WantsTobeAcat
    @WantsTobeAcat Před 3 lety

    thank you!!!very useful!!!!!!!!!!

  • @andreabutalid1958
    @andreabutalid1958 Před 4 lety +1

    PROBLEM FIXED BY ME: ANDREA MAE BUTALID
    FOR THOSE IMAGES STILL NOT APPEAR
    IMAGE DATA TYPE (TYPE) WILL BE BLOB IN DATABASE WHILE MAKING TABLE AND INSERT YOUR DATA IN DATABASE BY UPLOADING THE IMAGE FILE IN DATABASE THANKS ME LATER HOPE YOU UNDERSTAND.

  • @KashifAli-tf4rc
    @KashifAli-tf4rc Před 5 lety +1

    Images/images/field how to get image from this path plz explain i will thankful to you

  • @abusufiun2343
    @abusufiun2343 Před 2 lety

    awsome

  • @usamanasir2965
    @usamanasir2965 Před 4 lety

    it still works great today

  • @allenbiju4966
    @allenbiju4966 Před 3 lety

    image not showing, this is my code

  • @graphicguru5902
    @graphicguru5902 Před 5 lety

    Sir issko agar delete karna ho toh kaise kareinge??plz reply...

    • @fundaofwebit
      @fundaofwebit  Před 5 lety

      Haa... we can delete by its id..
      Sorry for late reply.. ws lil busy..

    • @fundaofwebit
      @fundaofwebit  Před 5 lety

      czcams.com/video/gj5c8lfnEuo/video.html

  • @omarykijogoo9216
    @omarykijogoo9216 Před 4 lety

    sorry iwant to learn how to search videos from mysql database using php and mysql help me

    • @fundaofwebit
      @fundaofwebit  Před 4 lety

      To Insert Video into Database u can use Upload in php
      czcams.com/video/QT2aFYbWP74/video.html
      Searching your video on the table ... by stored names u can use.. datatables
      czcams.com/video/oOL--VASs8Q/video.html

  • @graphicguru5902
    @graphicguru5902 Před 5 lety +1

    Sir image tag ka Samaj nhi aaya ...plz explain??

    • @fundaofwebit
      @fundaofwebit  Před 5 lety

      Doubt pucho... tab hi I can explain... like.. ur image is nt fetched ya.. aur kch..

    • @sanketswami260
      @sanketswami260 Před 3 lety

      @@fundaofwebit hi sir it shows fatal error: Uncaught TypeError: mysqli_fetch_array():

  • @graphicguru5902
    @graphicguru5902 Před 5 lety

    undefined index error dekha rha hai??plz help...

  • @shamshad52
    @shamshad52 Před 5 lety

    image is not showing, plz help me

  • @mwaurakennedy1705
    @mwaurakennedy1705 Před 2 lety

    another one down thanks

  • @mathandinformationtechnolo1549

    Where its data base video?

  • @vitvitvitvitvitvitvitvit

    Thanks B)

  • @UzairKhan-if5uh
    @UzairKhan-if5uh Před 3 lety

    bro dont mind but in this video you are doing only your work , you are not teaching how to do that... but well effort...

  • @sayanti1998
    @sayanti1998 Před 4 lety

    Image fetch nhi ho rahe please solve it

  • @navjotsingh2457
    @navjotsingh2457 Před 3 lety

    ty

  • @chathurangabandara6145

    not working - get an error unexpected T_string. why?

  • @graphicguru5902
    @graphicguru5902 Před 5 lety

    sir meri image show nhi ho rhi??

  • @pixel3616
    @pixel3616 Před 3 lety

    can you send source code

  • @kamleshteli2295
    @kamleshteli2295 Před 4 lety

    i want source code sir

  • @allworldentertainment1759

    upload image code

  • @infekted5944
    @infekted5944 Před 4 lety

    Funda meyer

  • @precillajansirani6933
    @precillajansirani6933 Před 3 lety

    I have use the code same as you used..
    here it is:

  • @ane-manda
    @ane-manda Před 4 lety

    thank you