$link= Mysqli_connect ("localhost","Root","Root")or die("Connect Error");if($link){Echo"Connect success
"; mysqli_select_db ($link,"World");$sql="SELECT * from City";$result= Mysqli_query ($link,$sql);$rows= Mysqli_num_rows ($result);$cols= Mysqli_num_fields ($result);Echo"Rows are".$rows.", cols is".$cols."
";Echo"echo"echo"while$row$resultecho" foreach$rowas$dataecho"Echo " Echo "
"; City
info
";
ID |
Name |
CountryCode |
District |
Population | "; (=mysqli_fetch_row ()) {
"; (){
". $data. " | "; }
"; }
";}Else{Echo"Connect Error";}?>
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the PHP connection database and read data printing, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.