zoukankan      html  css  js  c++  java
  • 2016.6.21 PHP与MqSQL交互之图片读取

    <td width="265">
    <?php
    mysql_select_db("member");
    mysql_query("set character set utf8");
    mysql_query("set name utf8");
    $result=mysql_query("SELECT * FROM `purchasemessages`where pur_tuijian=1 order by pur_id desc limit 0,1");
    $info=mysql_fetch_array($result);
    if($info==false){
    echo "本站暂无商品!";
    }
    else{
    ?>
    <table width="270" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="130" rowspan="5"><div align="center">
    <?php if(trim($info[pur_pic]=="")){
    echo "暂无图片";
    }
    else{
    ?>
    <img src="<?php echo $info[pur_pic];?>" width="80" height="80" border="0">     //MySQL中读取的是图片的相对路径,这个相对路径存储在字段pur_pic下                                                                                                                                       (..Images8.jpg)
    <?php
    }
    ?>
    </div>
    </td>

  • 相关阅读:
    KVM环境搭建RHCS
    修改virt-manager默认磁盘格式
    前端基础之html
    并发编程
    网络编程
    常用模块
    模块与包
    迭代器、生成器、面向过程编程
    闭包函数和装饰器
    函数
  • 原文地址:https://www.cnblogs.com/hqutcy/p/5605060.html
Copyright © 2011-2022 走看看