Selecting a float in MySQL

后端 未结 8 2047
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 08:35

I am trying to do a SELECT match on a table based upon an identifier and a price, such as:

SELECT * FROM `table` WHERE `ident`=\'ident23\' AND `         


        
8条回答
  •  粉色の甜心
    2020-11-29 08:39

    I was searching for solution but finally I did it using my previous php number_format() which came in seeing @hmasif's solution.

    Use this and you'll get your float - mysql match:

    $floatmatch = number_format((float)$yourfloatvariable,5);
    

    where 5 is five strings from decimal point. e.g. 7.93643

提交回复
热议问题