我還需要使用mysqli_query($ connection,$ results);和mysqli_close($ connection); ?我需要保留mysqli_query()和mysqli_close()嗎?
$sql = $connection->prepare("INSERT INTO pawnshop ".
"(Pawnshop_Name, Street, Barangay, City, DTI_Permit_No, Mayor_Permit_No, Firstname, Middlename, Lastname, Contact_Number, Email_Address, Password) ".
"VALUES ".
"(?,?,?,?,?,?,?,?,?,?,?,?)");
$sql->bind_param("ssssiissssss", $pawnshopName, $street, $barangay, $city, $dtiPermitNo, $mayorPermitNo, $firstName, $lastName, $middleName, $contactNumber, $email, $password);
$sql->execute();
$results = $sql->get_results();
mysqli_query($connection, $results);// Do I still need this?
mysqli_close($connection); //Do I still need this
閱讀說明書http://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php - 簡短的回答:沒有。長答案。 'mysqli_query($ connection,$ results); //我是否仍然需要這個?'** NO。** - 'mysqli_close($ connection); //我是否仍然需要這個'無關緊要,只要你沒有在另一個查詢之下進行查詢,如果你還有更多的事情要做。 –
'mysqli_query($ connection,$ results); //我還需要這個嗎?'http://php.net/manual/en/mysqli-stmt.get-result.php'$ result = $ stmt-> get_result (); while($ row = $ result-> fetch_array(MYSQLI_NUM))'如果您要打印行,**是。** –
可以使用sql-> close();?比mysqli_query()和mysqli_close()。 – soyan