Incorrect value is inserted in database

前端 未结 1 1248
滥情空心
滥情空心 2021-01-25 21:14

I have this code:

相关标签:
1条回答
  • 2021-01-25 21:48

    You are casting it to a number (actually a double) when you bind it to the query. You need to use s instead of d:

    $stmt->bind_param('d', $e);
    

    should be

    $stmt->bind_param('s', $e);
    

    See the manual on types:

    i   corresponding variable has type integer
    d   corresponding variable has type double
    s   corresponding variable has type string
    b   corresponding variable is a blob and will be sent in packets
    
    0 讨论(0)
提交回复
热议问题