Displaying Images from a MySQL Database using PHP

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • This is a video walk through of placing image content inside a MySQL database and then using PHP and SQL to extract the content from the MySQL database into an HTML webpage.
    Full Tutorial: codeadam.ca/le...
    Code: github.com/cod...
    PHP: www.php.net/
    ---
    Website: codeadam.ca/
    Twitter: / codeadamca
    Instagram: / codeadamca
    GitHub: github.com/cod...
    Music: The Lounge from Bensound.com

КОМЕНТАРІ • 27

  • @256gardenofgod8
    @256gardenofgod8 3 роки тому +2

    Just solved my problem thanks

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

    Thank you very much

  • @spotshot8867
    @spotshot8867 Рік тому +1

    thank you

  • @hebaadelali
    @hebaadelali Рік тому

    Worked! thank u

  • @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.

  • @amonkasokomba7508
    @amonkasokomba7508 Рік тому +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.

  • @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  Рік тому +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 :)

  • @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.

  • @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!

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

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