douyi1966 2015-05-24 00:07
浏览 67

根据每个ID的自定义公式,仅使用1个输入字段更改MySQL价格?

I have a database with some prices in it: enter image description here

But I want that I can give every id a formula like : [thatnumber] * or / or - or + . = [AndShowThatPrice]

So for a example: I want just to type here a price: enter image description here

If I type 10 then I want that the formula for the id=0 will be like: 10 * 8 = 80 <<--- Update to that price in MySQL

And so I want to give each id a formula So for id=1 example: 10 + 140 = 150 <<--- Update to that price in MySQL

* I just want to type the total price in one field, like : 10, then from that value the math will be made and the total price will updated in the database *

  • 写回答

3条回答 默认 最新

  • dongzhan2029 2015-05-24 00:16
    关注

    You would need at least one other field on the table that would contain your math for prices. For instance a field called math that would be +140. The you could do an update statement with one input box

    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错