php - bindParam gives Invalid parameter number -
im trying prepared statements send data table. giving me error. doing wrong? did wrong here?
error: sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens
my code below
$stmt = $conn->prepare("insert mystic_male (id, name, m1, m2, m3, m4, m5, m6, m7, m8, m9, time) values (:id, :name, :m1, :m2, :m3, :m4, :m5, :m6, :m7, :m8, :m9, current_timestamp)"); $stmt->bindparam(':id', $id); $stmt->bindparam(':name', $name); $stmt->bindparam(':m1', $m1); $stmt->bindparam(':m1', $m2); $stmt->bindparam(':m1', $m3); $stmt->bindparam(':m1', $m4); $stmt->bindparam(':m1', $m5); $stmt->bindparam(':m1', $m6); $stmt->bindparam(':m1', $m7); $stmt->bindparam(':m1', $m8); $stmt->bindparam(':m1', $m9); // insert row $id = ""; $name = "$ps0"; $m1 = "$ps1"; $m2 = "$ps2"; $m3 = "$ps3"; $m4 = "$ps4"; $m5 = "$ps5"; $m6 = "$ps6"; $m7 = "$ps7"; $m8 = "$ps8"; $m9 = "$ps9"; $stmt->execute();
Comments
Post a Comment