php - Mysqli update throwing Call to a member function bind_param() error -
hi have 70/80 field form need insert table instead of manually creating 1 huge insert statement firstly have created table in db names of inputs in form here code use create/alter table function createtable($array, $membermysqli) { foreach ($array $key => $value) { //echo "<p>key: ".$key." => value: ".$value . "</p>"; $query = "alter table questionnaire add ".$key." text"; if($stmt = $membermysqli->prepare($query)) { $success = $stmt->execute(); } } echo "<h1>array count: ". count($array) ."</h1>" ; } this works fine , altered table how wanted it. insert form values basic 1 field insert store id of row , have loop post variables updating row. here code that: $stmt = $membermysqli->prepare("insert questionnaire(userid) values (?)"); $stmt->bind_param('s'