dongsui8162 2014-10-30 10:48
浏览 43

检查一列中的值以在另一列中显示信息

In the method of getting the product the user has paid to buy, there are two options: delivery and pick-up/infistall.

If delivery, then the user will write the address where the product will have to address.

If pickup/infistall, the user will choose the nearest place/stall to pick up the product.

All the information will posted on the input form.

Now I want to get the data to show in the page after the user has chosen the method of getting the product.

I create a new column in the table named as method.

I want to check in the table of method:

  • If the row in the column method is delivery, then find the information in the row in the column delivery.
  • And vice versa, If the row in the column method is infistall, then find the information in the row in the column infistall.

enter image description here

  • 写回答

2条回答 默认 最新

  • dongzhoulong1797 2014-10-30 10:56
    关注

    Try sql like such in php (I suppose you can deal with sql query in PHP):

    select Method,IF(Method='Infistall',Infistall,Delivery) as Detail from product_table
    

    It would give result like that:

    Method     | Detail
    -----------|----------
    Infistall  | Address_Infistall
    Delivery   | Address_Delivery
    
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度