Insert and Fetch Images From Mysql Database in PHP

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 163

  • @YashPatel-vw9nz
    @YashPatel-vw9nz 5 років тому +4

    I barely write in a comment in youtube videos like in last 5 years I have only written to 2-3 videos. I have to comment on your video like its the best video on youtube in which it shows how to upload a video so I can't thank enough. All I can do is thank you very very much.

  • @giulioaltomari4972
    @giulioaltomari4972 3 роки тому

    i spent an entire day not figuring out why i displayed some random code instead of the images, then i came upon this video......... may god bless you and base64

  • @jaymeenpatel94
    @jaymeenpatel94 7 років тому +1

    Great work dude !
    I was getting an error for so long and finally got the required output. Thanks man, helped a lot.

  • @nakulsuryan9376
    @nakulsuryan9376 6 років тому +1

    woww... i finally found best solution for my project. thanks a lot

  • @imyou1166
    @imyou1166 5 років тому

    I can pay you if you teach like this. So simple easy to understand. Wow. good job..

  • @sherieklappenbach4858
    @sherieklappenbach4858 5 років тому +85

    JEEEEEZ the voice makes it so hard to follow!

  • @FreedomForKashmir
    @FreedomForKashmir 5 років тому +16

    Solution to issue ::
    If someone having issue that whole picture is not displaying properly or 1/5th of the picture is displaying ............then change the datatype of name column from "BLOB" to "LONGBLOB" in your database.
    Hopefully it will help

    • @chamlylorence7087
      @chamlylorence7087 5 років тому +2

      thank you very much for this clue , i solved my problem from this , again thank you so much !

    • @ichigo2012hollowmask
      @ichigo2012hollowmask 5 років тому

      I did that and although my images are uploaded, the preview for them is still broken and not working. Also, it keeps inserting images when the page is refreshed.

  • @mitu9881
    @mitu9881 6 років тому +1

    thanks everything works perfectly . i have changed the BLOB to LONGBLOB so that now i can insert an image with size of more than 64kb .

  • @HamzaKhan-fl8fp
    @HamzaKhan-fl8fp 3 роки тому

    wow its magic i am working from an hour and just watch 1o sec of this video makes me correct

  • @pranavkurkure6091
    @pranavkurkure6091 4 роки тому

    best tutorial so far...thanks

  • @usama57926
    @usama57926 5 років тому +2

    thank u so much sir u solved my problem

  • @gustavemuhoza6281
    @gustavemuhoza6281 4 роки тому

    Great, Everything is working properly

  • @vinaykamble1736
    @vinaykamble1736 3 роки тому

    Really thank you sir, this video helps me a lot to complete my project.

  • @palashmitra7311
    @palashmitra7311 8 років тому +1

    I am looking such tutorial now.
    thanks.

  • @newtech9593
    @newtech9593 5 років тому

    Thank you very much you solved my big problem Thank you again

  • @ABHISHEKKUMAR-wf3yh
    @ABHISHEKKUMAR-wf3yh 6 років тому

    great man.....after a long time something usefull

  • @yasminmogal3381
    @yasminmogal3381 4 роки тому

    Thank you so much it was very useful for beginners

  • @alisapopa937
    @alisapopa937 5 років тому +1

    You're the beeeest! Thank you!

  • @syedsahmokhdunjunnun5783
    @syedsahmokhdunjunnun5783 7 років тому +1

    Thanks a lot sir

  • @dotriko426
    @dotriko426 7 років тому +1

    thanks dude,.. life saver!

    • @webslesson
      @webslesson  7 років тому

      Thank you dot riko for your thoughtful words.

  • @tijanimustapha9376
    @tijanimustapha9376 5 років тому

    thank you very much "problem solve"

  • @OSTAZGZ
    @OSTAZGZ 7 років тому

    THANKS BRO VERY THANKS KIP going man

  • @albertgarcia6483
    @albertgarcia6483 7 років тому

    nice work bro. i hope you made a lot of tuts for us to learn more. thank you.

    • @webslesson
      @webslesson  7 років тому

      Oh, thank you Albert Garcia! Always at your service.

  • @sexyboi69
    @sexyboi69 7 років тому +1

    Thank you sir,

  • @crazcoder4243
    @crazcoder4243 5 років тому

    Works for me thanks

  • @Lifestyle12
    @Lifestyle12 5 років тому

    yaayyyy ,it proved helpful for me. thankyou:)

    • @haroonshahzad278
      @haroonshahzad278 5 років тому

      Habiba Hassan its realy helpful , do you have any isue ?

  • @osharaoshara6900
    @osharaoshara6900 5 років тому

    Thank you very much sir..

  • @yogeshchandra9603
    @yogeshchandra9603 4 роки тому

    thank you bro.. really

  • @montytomar6388
    @montytomar6388 7 років тому

    thanks,it really helped me

  • @AmanDeep-oo4nw
    @AmanDeep-oo4nw 7 років тому

    Thanxs Dude :) Helped a Lot ...

  • @obipascalbanjuare1854
    @obipascalbanjuare1854 5 років тому

    Greate

  • @andreiplesa709
    @andreiplesa709 7 років тому +5

    my ass ql, I'm dying

  • @technicalgyan7572
    @technicalgyan7572 5 років тому

    thank you, sir, to the solution.

  • @stephenlance6402
    @stephenlance6402 7 років тому

    awesome

  • @arunasokan6048
    @arunasokan6048 5 років тому +1

    Great code. Thanks for the help man. But need a help! What if i want to display only one image at a time, the image which I recently inserted into the database. Thanks in advance... Cheers again

  • @MAAZKHAN-xv1lc
    @MAAZKHAN-xv1lc 3 роки тому

    Please start the WordPress plugin development course

  • @tichachamumapfanyangira1539
    @tichachamumapfanyangira1539 4 роки тому

    works thank you

  • @muhammadawais7563
    @muhammadawais7563 7 років тому

    Dude , you are awesome :)

    • @Dexter101x
      @Dexter101x 6 років тому

      Its a fucking computer voice

  • @yahyashaikh1412
    @yahyashaikh1412 6 років тому

    thanks, buddy

  • @sabaparsa8939
    @sabaparsa8939 5 років тому

    Thanks a lot

  • @afsaralishaikh1038
    @afsaralishaikh1038 3 роки тому +1

    Is there is any way to see uploaded images on other page?
    Plz revert if anyone knows

  • @aflahm6819
    @aflahm6819 6 років тому

    thankyou

  • @subhih.hamdoon
    @subhih.hamdoon 6 років тому

    Greeting, I am happy and lucky to see this script. I ask if there any other script which shows how to retrieve text from the database file, together with MPEG/audio file and display both of them on the same page. ( it looks like one speak what he read from display text page. Waiting for your reply.
    Best regards

  • @anthonyjennifer4755
    @anthonyjennifer4755 3 роки тому

    sir please how do see how u created the database and the way u saved ur images

  • @ahmedoun2152
    @ahmedoun2152 4 роки тому +2

    PLZ i want an explication for this line
    what i must put in this parameter data:

  • @mot.z795
    @mot.z795 4 роки тому

    thank-you ^_^

  • @usama57926
    @usama57926 5 років тому +3

    my code is perfectly working but i have a problem...
    when i retrieve the image back from database then sometimes the image is blurred or cropped...
    So why this happening?

    • @benjaminvandenberg6348
      @benjaminvandenberg6348 4 роки тому +1

      Maybe because your picture was to big, so it got cropped. Change the upload restriction in your php.ini file

    • @usama57926
      @usama57926 4 роки тому +1

      @@benjaminvandenberg6348 thanks man

  • @jannath-hussain
    @jannath-hussain 5 років тому

    awesome but need to store the image in the directory not in database.. pls make the video of it thanks in advance.. and please use header function to redirect the page so that it cant be reinserted into the database again..

    • @sabrizone
      @sabrizone 5 років тому

      ua-cam.com/video/sIii4nF702g/v-deo.html
      check this out bro

  • @fernandaayala5632
    @fernandaayala5632 4 роки тому

    I FUCKING LOVE YOU SO MUCH, THAN YOU LOTS

  • @tijanimustapha9376
    @tijanimustapha9376 5 років тому +2

    the image is not displaying from sql, it only show an image sign 'img'

  • @ptrsebastian1
    @ptrsebastian1 4 роки тому +1

    if nothing happens CHANGE BLOB with LONGBLOB

  • @codemantri7687
    @codemantri7687 5 років тому +2

    image is getting inserted but not retreving back it shows blANK THERE

  • @agresiv0
    @agresiv0 5 років тому

    Friend, by any chance do you have a video in PDO?

  • @cheongjiayun3901
    @cheongjiayun3901 5 років тому

    +Weblesson I have followed your way to insert the image to the database no error popped out but it doesnt insert into the database. Plz help me check my problem

  • @asit009
    @asit009 5 років тому +1

    sir Please Help Me refresh web browser same image is inserted again

  • @neighbourhoodcoder5988
    @neighbourhoodcoder5988 3 роки тому

    you should have use react to make it more complicated.

  • @jyothis9350
    @jyothis9350 4 роки тому

    hi sir,
    how to include uploading image as an optional field in the form?

  • @mannaweb4634
    @mannaweb4634 7 років тому

    look better

  • @sivapriyat8574
    @sivapriyat8574 2 роки тому

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BINARY NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB' at line 1
    how to clear this error

  • @Kasador
    @Kasador 5 років тому +1

    *Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean*
    This doesn't work; or I should it works up until' inserting the image.
    *EDIT:*
    I fixed mine by changing _ORDER BY id_ to _ORDER BY imgId_ because I changed my primary key in my MySQL to be imgId not _id_
    Also, I'd like to mention that I've added this as well;
    if($result === FALSE) {
    die(mysql_error());
    alert('An error occurred. Please clear cache, refresh page, and try again...');
    }
    *Happy Coding Y'all!*

  • @robroy4046
    @robroy4046 5 років тому

    but if you try to refresh the page after you submit it will submit again, do you have solution with that?

  • @heyitsarii78
    @heyitsarii78 5 років тому

    Hi could someone please help me, how can i do this things. I want to upload image and insert in into database along with the user id that is currently using that session. Previously I’ve tried some method same as this tutorial but it only stores the image that have been uploaded without storing the user id. How can i do this? 😢

  • @agnieszkaryznar6775
    @agnieszkaryznar6775 5 років тому

    can we use PDO instead of mysqli?

  • @methijrah2970
    @methijrah2970 6 років тому

    maybe i love you :v hahaha thanks

  • @nashas6778
    @nashas6778 6 років тому

    advanced registration form include image upload and cv upload can you please upload this?

  • @amutharavikumar4651
    @amutharavikumar4651 7 років тому

    Thank u so much it's working

  • @shalini15cs98
    @shalini15cs98 6 років тому +1

    Undefined index: name in C:\xampp\htdocs\dbmsproject\sale.php on line 45
    this error is coming,please rectify

    • @phumlanimthembu3981
      @phumlanimthembu3981 5 років тому

      Shalini 15CS
      Did you happen to get the solution to this??
      I tried to use all my knowledge I'm not getting it..

    • @ichigo2012hollowmask
      @ichigo2012hollowmask 5 років тому

      @@phumlanimthembu3981 Make sure you're using the exact names from your own mysql database columns.

  • @joshuaolushola9780
    @joshuaolushola9780 3 роки тому

    What if I need to upload more than one image in a single code?

  • @kaderobaidul9816
    @kaderobaidul9816 4 роки тому

    How to add database.please detail

  • @diehard-fans1
    @diehard-fans1 10 місяців тому

    is this oky to run in vs code

  • @Kevin-xf3ke
    @Kevin-xf3ke 5 років тому

    why does it show all the photos on the bottom in the database? i just wanna see the most recent one I uploaded...

  • @vinaykamble1736
    @vinaykamble1736 3 роки тому

    Sir but it is not working if image is png

  • @edwinbessard7563
    @edwinbessard7563 5 років тому

    when i press the insert button, it says no file selected.
    please help. thanks

  • @tetsushirokun3580
    @tetsushirokun3580 5 років тому

    when i try to refresh the picture re inserted again and it became 2 same pictures then when i try to put another picture and inserted it the result will be my first 2 same picture + 1 new saved picture please help me fix it

    • @jannath-hussain
      @jannath-hussain 5 років тому +1

      use php header function to redirect to the same page like header('Location:filename.php');

  • @vinodverma2618
    @vinodverma2618 6 років тому

    how to add upload and cancel images in uploading time and preview show

  • @waqasbhatti4478
    @waqasbhatti4478 4 роки тому

    i am unable to store 1mb size image using blob can u help me

  • @m.mudassernazir4788
    @m.mudassernazir4788 5 років тому

    I have the error that image is not display on browser
    the error is:
    GET data:image/jpeg;base64,'.base64_encode($row['image']).' net::ERR_INVALID_URL

  • @roselynptrck7329
    @roselynptrck7329 11 місяців тому

    hello sir, can i know how to delete multiple picture on php ?

  • @nashas6778
    @nashas6778 6 років тому

    how to insert image into database and a image folder using php mysql pls upload this

  • @RosevirCeballosJr
    @RosevirCeballosJr 5 років тому

    Cannot view if image is in JPEG. Only works for PNG

  • @alquinrexdomenden7302
    @alquinrexdomenden7302 8 років тому

    hello sir may i requested to your channel on how to upload,download, delete a files(like .docs,.pdf,.exe).

  • @badboys1019
    @badboys1019 7 років тому

    ohh sorry i corrected the erro .. well actually i am facing an issue while displaying an images from database when i am using pdo, so can you help me with this topic

  • @nuramirahsyahirahzainurin6151
    @nuramirahsyahirahzainurin6151 3 роки тому

    Did anyone know how to edit/update if it is involve pdf file?

  • @bobspoon5481
    @bobspoon5481 5 років тому +2

    my image isn't being fully display , then i made
    `name` blob NOT NULL,
    into
    `name` longblob NOT NULL,
    and it worked perfectly..

    • @sagarverma681
      @sagarverma681 4 роки тому +1

      BLOB stands for “binary large object”, perfect for storing our uploaded image files. Take note that:
      BLOB will only hold up to 64 KB of data.
      MEDIUMBLOB holds up to 16 MB of data.
      LONGBLOB up to 4 GB of data.

  • @asit009
    @asit009 5 років тому

    how to solve refresh web browser same image is inserted again

  • @fhadillahshahran8560
    @fhadillahshahran8560 5 років тому

    how can i display one image same id on php

  • @mahboobalam9590
    @mahboobalam9590 7 років тому

    $file = addslashes(file_get_contents($_FILES["image"]["temp_image"]));
    my 5 number line is this.....what is the error please tell me fast its urgent........

  • @macba2000id
    @macba2000id 5 років тому

    I got this messages everytime I click insert " Notice: Undefined index: name in C:\xampp\htdocs\testing\index.php on line 45"
    somebody help me,please...and this is line 45 above declared:

  • @tengkusyafiz
    @tengkusyafiz 6 років тому

    why my image won't display?

  • @aditisaini7407
    @aditisaini7407 6 років тому

    sir a simple project in codeigneter create .

  • @osmanelsharif533
    @osmanelsharif533 3 роки тому

    How to update img

  • @muhammadawais7563
    @muhammadawais7563 7 років тому +4

    +Weblesson your code have one issue that after refresh same image is inserted again .

    • @codingpathshala
      @codingpathshala 5 років тому

      redirect to another page using window.location.href="redirect.php"

    • @Princejay-xu7ed
      @Princejay-xu7ed 5 років тому

      where i will put this code? in the php? or javascript?

    • @jannath-hussain
      @jannath-hussain 5 років тому +2

      use php's header('Location:filename.php');
      or you can use javascript redirect like above

  • @baidhyaorish1897
    @baidhyaorish1897 5 років тому

    i havea an error( Undefined index: temp_name) on temp_name ($file=addslashes(file_get_contents($_FILES["image"]["temp_name"]));)

    • @MrJeske999
      @MrJeske999 5 років тому

      It is "tmp" and not "temp"

  • @thefinelearnlearningchanne3610
    @thefinelearnlearningchanne3610 7 років тому +3

    everything is ok, but image output is broken, what can i do ?

    • @sabrizone
      @sabrizone 5 років тому

      same with me
      whats the solution now please help me

  • @webslesson
    @webslesson  5 років тому

    Insert Multiple Images into Mysql Database using PHP Ajax - ua-cam.com/video/kpGLb76iqro/v-deo.html

  • @diseaseandtreatment7033
    @diseaseandtreatment7033 4 роки тому

    JavaScript code not work

  • @dimitrijejovanovic6779
    @dimitrijejovanovic6779 6 років тому

    I hope there is no AJAX here? :)

  • @shalini15cs98
    @shalini15cs98 6 років тому

    weblesson
    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\dbmsproject\sale.php on line 40
    please correct this error

    • @Bri8765n
      @Bri8765n 6 років тому

      fetch_assoc()

  • @StefanoGentile01
    @StefanoGentile01 4 роки тому

    doesn't work

  • @rockstar10474
    @rockstar10474 5 років тому

    It doesn't work properly