Displaying Images from a MySQL Database using PHP

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ย. 2024

ความคิดเห็น • 27

  • @256gardenofgod8
    @256gardenofgod8 3 ปีที่แล้ว +2

    Just solved my problem thanks

  • @spotshot8867
    @spotshot8867 ปีที่แล้ว +1

    thank you

  • @hebaadelali
    @hebaadelali ปีที่แล้ว

    Worked! thank u

  • @prasannasilva7754
    @prasannasilva7754 3 ปีที่แล้ว +1

    Thank you very much

  • @Bint_e_Iqbal
    @Bint_e_Iqbal ปีที่แล้ว

    It worked! Thanks. But can we resize the image? I don't know the coding for that can we resize these images? I want to make it smaller

    • @codeadamca
      @codeadamca  ปีที่แล้ว +1

      Yep! You can resize is using CSS or the WIDTH attribute. Or you can resize the image using something like WideImage (wideimage.sourceforge.net/).

  • @hitech9661
    @hitech9661 2 ปีที่แล้ว

    Hi, I have a question, can you create a code which changes a logo from a normal one to another one with santa hat during a given period

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว

      You could, you would just need to create a PNG image with that Santa hat, that lines up when placed on top. The term you want to Google is "watermark". I use a small PHP library called WideImage for simple image manipulation with PHP. WideImage as a few tools to add watermarks.
      wideimage.sourceforge.net/

  • @spacerabbitk
    @spacerabbitk 2 ปีที่แล้ว

    I doun't understans why moving the images from the main folder sends broken images on the webpages, if they are supposed to be called from the database not from the main folder

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว +1

      The images references are in the database. But the actual images are in the filesystem. The URLs generated using the database references still needs to reference the actual location of the images. So if the images are in an "images" folder and the file name is in the database (field.jpg) we need to combine those to to get a working image in your HTML.

    • @lionelfloriani8874
      @lionelfloriani8874 ปีที่แล้ว

      @@codeadamca So what's the point of all of this? I don't get it sorry. Why not just use the HTML way to display the images if those aren't stocked directly on the server?

    • @codeadamca
      @codeadamca  ปีที่แล้ว

      @@lionelfloriani8874 This is just an intro to using images and a database. But eventually you could create an application where someone logs in, uploads their image (like Instagram, Facebook, etc...), PHP saves the image in a folder, places the reference in the database, and next time the page loads, it includes the new image. So the page content was updated without anyone touching any code.

    • @lionelfloriani8874
      @lionelfloriani8874 ปีที่แล้ว

      @@codeadamca Oh ok! Sorry, I didn't mean to be rude or anything, I just didn't understand :p I am currently on my path to be WebDeveloper, there is so much stuff to know/understand sometimes I get lost. Thanks for answering and for your videos :)

  • @genosthegreat7870
    @genosthegreat7870 3 ปีที่แล้ว +4

    Thank u
    But the screen is so small

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว

      I know, I'm sorry. My fonts are larger in more recent videos! Maybe I'll get around to fixing the old ones one day.

  • @threalinsideout1368
    @threalinsideout1368 2 ปีที่แล้ว

    What about the second example... I need the second example. The first is not safe

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว +1

      I did not do the second version in this video, but I did in the Creating a PHP CMS videos, you could check those out if you're still looking.

    • @threalinsideout1368
      @threalinsideout1368 2 ปีที่แล้ว

      @@codeadamca thank you, I've already figured it out. Thank you for your contribution 🙂

  • @100bitCoding
    @100bitCoding 2 ปีที่แล้ว

    IDE Font size is so small, couldn't see properly

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว

      I know. More recent videos the text is larger. Sory!

  • @heythere_696
    @heythere_696 2 ปีที่แล้ว

    it read the name & the file name but it don't show the image. 🥺

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว

      If you're testing your files by uploading them to your server, make sure you upload the files too! If that doesn't help, I would need to see your code to help.

  • @amonkasokomba7508
    @amonkasokomba7508 2 ปีที่แล้ว +1

    It's hard to see, why don't you zoom in on the area you are talking about.
    If you want to teach people, You don't have to put the small screen showing the face. Just show want you are talking about and your voice in the background.

    • @codeadamca
      @codeadamca  ปีที่แล้ว

      Sorry! I do increase my font size in more recent videos.

  • @edueuller5976
    @edueuller5976 3 ปีที่แล้ว +1

    didn't solve my problem at all dude, worse of all times, but tks lol

    • @codeadamca
      @codeadamca  2 ปีที่แล้ว

      Sorry it didn't help!