mymysql
mymysql copied to clipboard
conn.Prepare “wrong number of values for bind ”
stmt, err := conn.Prepare("INSERT INTO `auto_price` VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")
if err != nil {
return 0, ok
}
rs, err := stmt.Run(nil, p.Auto_type_id, p.Auto_brand_id, p.Auto_Company_id, p.Auto_Serial_id, p.Dealer_id, p.Dealer_state, p.Dealer_grade,
p.Price0, p.Prices, p.Pricediff, p.Discount, p.Updatetime, p.Expiredate, p.Source_level, p.Url, p.Memo, 0, p.Province_id, p.City_id, p.Tichedate, "0")
if err != nil {
fmt.Println(err) // "wrong number of values for bind "
return 0, ok
} else {
ok = true
}
There is no way to know which field is wrong ?
I'm sorry, is my own negligence, I bind a field value less. -_-