|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-16 23:15 UTC] uw@php.net
[2009-09-17 07:13 UTC] uw@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ Mysqli_info doesn't seem to return results when using INSERT .. values Reproduce code: --------------- <?php $link = mysqli_connect( 'host,'un', 'pw' ) or die("Connect to db didn't work..."); $crlf=chr(13) .chr(10); $test = mysqli_query($link, "CREATE DATABASE IF NOT EXISTS test") or die("Create db didn't work..."); $test = mysqli_query($link, "USE test") or die("Use TEST db didn't.."); $test = mysqli_query($link, "CREATE TEMPORARY TABLE IF NOT EXISTS t1 (city varchar(30))") or die("Create Temp Table didn't work..."); $data = mysqli_query($link, "INSERT INTO t1 (city) VALUES ('Tulsa')") or die("Insert data didn't work..."); $info_from_insert = mysqli_info($link); print_r("mysqli_info values from 'INSERT' = $info_from_insert $crlf"); print_r("Var_Dump of mysqli_info = "); var_dump($info_from_insert); print_r("---------$crlf"); $data= mysqli_query( $link , "SELECT CITY FROM t1 " ) or die("Select statement didn't..."); $rows = mysqli_affected_rows($link); echo "Rows 'Affected' = $rows $crlf"; //- Get number of affected rows in previous MySQL operation $select_info = mysqli_info($link); print_r("select info: $select_info $crlf"); print_r("Var_Dump of mysqli_info = "); var_dump($info_from_insert); echo $crlf; $mysqli_test = mysqli_fetch_all($data, MYSQLI_ASSOC) ; echo "results from mysqli_fetch_all..$crlf"; var_dump($mysqli_test); ?> Expected result: ---------------- Expect text string show the results of the insert. Actual result: -------------- Results of Insert query returns a string(0) as shown with a Var_dump