php - Mysqli prepared statements fetch_array -
i trying below code working not working , giving me below error
fatal error: call member function bind_param() on non-object in is there way fetch array prepared statements?
if (move_uploaded_file($_files['file_to_upload']['tmp_name'], $final_uploads_location)) { $stmt = $mysqli->prepare("select * test `username` = ? , `age` = ? "); $stmt->bind_param('ss', $username, $age); $stmt->store_result(); $stmt->execute(); if($stmt->num_rows < 1) { $insert = $mysqli->prepare("insert `test`(`username`, `age`, ) values(?,?)"); $insert->bind_param('ss', $username, $age); $insert->execute(); } else { $check = mysqli_fetch_array($stmt); global $identity; } }
you query return false after preparing(mysqli::prepare). means query has error: undefined fields, unexisting table or something.
Comments
Post a Comment