Very new to PHP5 and have some problems still. I figured out how to Select with prepared statements now trying to insert/update my code is as follows
function input_lab_results($name, $image, $descrip) { $query = 'INSERT INTO pat_table (pat_name, pat_image, pat_descrip, pat_doctor, pat_resident, pat_create, pat_modify) VALUES (?, ?, ?, ?, ?, ?, ?)'; if($stmt = $this->conn->prepare($query)){ $stmt->bind_param('sssiidd', $name, $image, $descrip, 0, 0, date('Ymd'), date('Ymd')); $stmt->execute(); die(); } else{ die($this->conn->error); } }
The error I am getting is
Fatal error: Cannot pass parameter 4 by reference html/classes/mySQL.php on line 43
Any help/references would be appreciated. Thank you.
Everyone is mentioning using PDO, do you guys have any good tutorials or examples of this please?
I changed it to
Basically I changed where it was reading the ?? for the integer to 0 in the query I didn’t bind it.