Intranet :http://manas9/BareBone_MySQL/Mysqli_query_Tool14.php
On Line MySQL-Query-with-PHP ||
IIS in windows 8.1 FastCGI Connecting as
$conn = mysqli_connect("server", "user", "pwd", "test");
Using Procedural Style $result= mysqli_query($conn, $sql);
re-load()||



:" . $sql .""; // $conn = mysqli_connect("localhost", "user", "pwd", "db"); // if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } // procedural way $result= mysqli_query($conn, $sql); if($result){ echo "
db connected"; } // $fieldcount=mysqli_num_fields($result); echo "
field count : " . $fieldcount ."
"; //fetch rows //$row = mysqli_fetch_array($result,MYSQLI_ASSOC); $finfo =mysqli_fetch_fields($result); //creating a table hearer with column names echo ""; echo ""; foreach ($finfo as $val) { $column_name = $val->name; echo ""; } echo "
".$column_name."
\n"; //creating out put table echo "\n"; // while loop both worked //while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { while ($row = mysqli_fetch_row($result)) { // foreach ($row as $item) { //echo "\n"; echo "\n"; } //foreach ends echo "\n"; // }//end while loop echo "
".($item !== null ? htmlentities($item, ENT_QUOTES):" ")."".($item)."
\n"; //closing output table $row_count = mysqli_num_rows($result); echo "row count " . $row_count; mysqli_free_result($result); // closing connection mysqli_close($conn); echo "
database connection closed"; }//isset block ends ?>