mysql - SQL Bound variables error -
i'm getting error in code. i'm sure means there wrong column=:variable section of code, i've gone on , can't see what's wrong.
fatal error: uncaught exception 'pdoexception' message 'sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens' in f:\... here code (long first line):
$stmt = $dbh->prepare("update item_list set quantity=:quantity, new_price=:newprice, image_link=:image_link, market_hash_name=:markethashname, last_update='1000-01-01 00:00:00', is_tradable='test', old_price=:oldprice item_name=:itemname , (image_link null or quantity null or new_price null or market_hash_name null or last_update null or is_tradable null or old_price null)"); $sql->bindparam(':quantity', $json2->quantity); $sql->bindparam(':newprice', $json2->lowest_price); $sql->bindparam('image_link', $image_link_full); $sql->bindparam(':markethashname', urlencode($mydata->market_hash_name)); $sql->bindparam(':oldprice', $json2->lowest_price); $stmt->bindvalue(':itemname', $mydata->market_name); $stmt->execute(); edit: image_link needed :image_link, still getting same error
edit 2: had lot wrong, using 2 names $sql , $stmt, using bindvalue instead of bindparam
you missing colon ':' before 'image_link' in bindparam statement.
Comments
Post a Comment