You must call mysqli_stmt_store_result() for every query that
successfully produces a result set (SELECT, SHOW, DESCRIBE, EXPLAIN),
and only if you want to buffer the complete result set by the client,
so that the subsequent mysqli_fetch() call returns buffered data.
Note:
It is unnecessary to call mysqli_stmt_store_result() for other queries,
but if you do, it will not harm or cause any notable performance in all cases.
You can detect whether the query produced a result set by checking if
mysqli_stmt_result_metadata() returns NULL.
$query = "SELECT Name, CountryCode FROM City ORDER BY Name LIMIT 20"; if ($stmt = mysqli_prepare($link, $query)) {
/* execute query */ mysqli_stmt_execute($stmt);
/* store result */ mysqli_stmt_store_result($stmt);
printf("Number of rows: %d.\n", mysqli_stmt_num_rows($stmt));
/* free result */ mysqli_stmt_free_result($stmt);
/* close statement */ mysqli_stmt_close($stmt); }
/* close connection */ mysqli_close($link); ?>
The above example will output:
Number of rows: 20.
Php mysqli stmt store result Function syntax tag
mysqli stmt store result php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php mysqli stmt store result syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.