diff --git a/reference/mysqli/mysqli_stmt/execute.xml b/reference/mysqli/mysqli_stmt/execute.xml
index 4c8077cdcb..e08d28e133 100644
--- a/reference/mysqli/mysqli_stmt/execute.xml
+++ b/reference/mysqli/mysqli_stmt/execute.xml
@@ -30,8 +30,10 @@
If the statement is UPDATE, DELETE,
or INSERT, the total number of affected rows can be
determined by using the mysqli_stmt_affected_rows
- function. Likewise, if the query yields a result set the
- mysqli_stmt_fetch function is used.
+ function. If the query yields a result set, it can be fetched using
+ mysqli_stmt_get_result function or by fetching it
+ row by row directly from the statement using
+ mysqli_stmt_fetch function.
@@ -63,7 +65,7 @@
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
-$mysqli->query("CREATE TABLE myCity LIKE City");
+$mysqli->query("CREATE TEMPORARY TABLE myCity LIKE City");
/* Prepare an insert statement */
$stmt = $mysqli->prepare("INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)");
@@ -85,15 +87,12 @@ $val3 = 'Aquitaine';
/* Execute the statement */
$stmt->execute();
-/* retrieve all rows from myCity */
+/* Retrieve all rows from myCity */
$query = "SELECT Name, CountryCode, District FROM myCity";
$result = $mysqli->query($query);
while ($row = $result->fetch_row()) {
printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]);
}
-
-/* remove table */
-$mysqli->query("DROP TABLE myCity");
]]>
&style.procedural;
@@ -104,7 +103,7 @@ $mysqli->query("DROP TABLE myCity");
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
-mysqli_query($link, "CREATE TABLE myCity LIKE City");
+mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City");
/* Prepare an insert statement */
$stmt = mysqli_prepare($link, "INSERT INTO myCity (Name, CountryCode, District) VALUES (?,?,?)");
@@ -126,15 +125,12 @@ $val3 = 'Aquitaine';
/* Execute the statement */
mysqli_stmt_execute($stmt);
-/* retrieve all rows from myCity */
+/* Retrieve all rows from myCity */
$query = "SELECT Name, CountryCode, District FROM myCity";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_row($result)) {
printf("%s (%s,%s)\n", $row[0], $row[1], $row[2]);
}
-
-/* remove table */
-mysqli_query($link, "DROP TABLE myCity");
]]>
&examples.outputs;