dqm88684 2017-05-02 11:14
浏览 36
已采纳

任何人都知道如何在mysql中存储图像并使用angular和php显示回来?

I have created a web page to display image, topic and details. Just now i have a static html page this is just a page i have nothing implemented any thing.

<section class="section-02">
        <div class="container">
    <h3>
            <div class="heading-large">Current Best</div>
          </h3>
    <div class="row">
            <div class="col-md-4">
        <div class="card"> <img class="img-fluid" src="img/media-1.jpg" alt="">
                <div class="card-block">
            <div class="news-title"><a href="#">
              <h2 class=" title-small">An Alternative Form of Mental Health Care Gains a Foothold</h2>
              </a></div>
            <p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
          </div>
              </div>
        <ul class="news-listing">
                <li><a href="#">Key Republicans sign letter warning against candidate</a></li>
                <li><a href="#">Obamacare Appears to Be Making People Healthier</a></li>
                <li><a href="#">Syria war: Why the battle for Aleppo matters</a></li>
                <li><a href="#">‘S.N.L.’ to Lose Two Longtime Cast Members</a></li>
              </ul>
      </div>
            <div class="col-md-4">
        <div class="card"> <img class="img-fluid" src="img/media-2.jpg" alt="">
                <div class="card-block">
            <div class="news-title"><a href="#">
              <h2 class=" title-small">Delta passengers got pizza delivered to the plane</h2>
              </a></div>
            <p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
          </div>
              </div>
        <ul class="news-listing">
                <li><a href="#">Syria war: Why the battle for Aleppo matters</a></li>
                <li><a href="#">Key Republicans sign letter warning against candidate</a></li>
                <li><a href="#">Obamacare Appears to Be Making People Healthier</a></li>
                <li><a href="#">‘S.N.L.’ to Lose Two Longtime Cast Members</a></li>
              </ul>
      </div>
            <div class="col-md-4">
        <div class="card"> <img class="img-fluid" src="img/media-3.jpg" alt="">
                <div class="card-block">
            <div class="news-title"><a href="#">
              <h2 class=" title-small">Minorities Suffer From Unequal Pain Treatment</h2>
              </a></div>
            <p class="card-text"><small class="text-time"><em>3 mins ago</em></small></p>
          </div>
              </div>
        <ul class="news-listing">
                <li><a href="#">‘S.N.L.’ to Lose Two Longtime Cast Members</a></li>
                <li><a href="#">Key Republicans sign letter warning against candidate</a></li>
                <li><a href="#">Obamacare Appears to Be Making People Healthier</a></li>
                <li><a href="#">Syria war: Why the battle for Aleppo matters</a></li>
              </ul>
      </div>
          </div>
  </div>
      </section>

now i want to store this in mysql database using angular and php

  • 写回答

1条回答 默认 最新

  • doujiao1905 2017-05-02 11:17
    关注

    Although it's technically possible to store an image in a BLOB type, I totally discourage you to do it and rather use a could-based filesystem such as S3 or the local filesystem of the server. Just store on the DB the URI of the image.

    Storing BLOBS in the DB will make it slower, the backups will take much longer and the queries must be optimized to avoid retrieving the BLOB. A simple SELECT * FROM users; can kill your DB if you have thousands of users.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况