php variable insert into database

后端 未结 2 1842
渐次进展
渐次进展 2021-01-19 08:31

I am attempting to insert some php variables into a Mysql database with no luck. The connection works no problem, the variables all have values, so I must be my insert stat

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-19 09:07

    If id is an autonumber field, you should not be passing '' in the insert - just drop the field and let your database take care of it. If it's not an autonumber, '' is probably not a valid key value.

    Also, if any of your fields are numeric, not text, they should not have single quotes around them. My guess would be that speed should be a number and should not be in quotes in your query.

    But please, PLEASE, look at the comments on your question -- this is bad code and the comments explain why.

提交回复
热议问题