search

Home  >  Q&A  >  body text

I have stored the path of the image in the database, but how should I write the background code to display the image in the foreground? It is not an upload function, but a function of getting the image from the database and displaying it in the foreground.

I have stored the path of the image in the database, but how should I write the background code to display the image in the foreground? It is not an upload function, but to obtain the image from the database and display it in the foreground.

..2388 days ago2062

reply all(3)I'll reply

  • 嘉俊

    嘉俊2018-05-04 14:39:27

    Just add the full path directly to the view template

    reply
    0
  • 一笑而过

    一笑而过2018-05-01 14:30:29

    Get the image path from the database: select path field form table name to query all data, directly pass the obtained data into the view and traverse it in the img tag

    reply
    1
  • .

    There is no need to splice the suffix of this picture. Do I need to splice the suffix only when uploading and downloading? I got this mixed up, thinking I also had to splice the suffix.

    . · 2018-05-01 17:56:03
  • Cancelreply