PHP如何查询MySQL数据页面输出内容

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

";
        echo "";
        for($i = 0;$i < $colums; $i++){
            
            $fieldName = mysql_field_name($result, $i);
            echo "$fieldName";
            
        }
        echo "";
        while($row=mysql_fetch_row($result)){
            echo "";
            for($i=0; $i<$colums; $i++){
                echo "$row[$i]";
            }
            echo "";
        }
        echo "";
    }
    
    // release result set 
    mysql_free_result($result);
    //close connection 
    mysql_close($con);
?>

PHP如何查询MySQL数据页面输出内容_第1张图片

 

";
                echo "";
                echo "id用户名性别地址国家";
                echo "";
                while ($userinfo = mysql_fetch_array($result)) {
                    $id= $userinfo["id"];
                    $name= $userinfo["username"];
                    $sex= $userinfo["sex"];
                    $address= $userinfo["address"];
                    $country= $userinfo["country"];
                    echo "";
                    echo "$id$name$sex$address$country";
                    echo "";
                }
                echo "";
        
    }
    
    // release result set 
    mysql_free_result($result);
    //close connection 
    mysql_close($con);
?>

PHP如何查询MySQL数据页面输出内容_第2张图片

转载于:https://my.oschina.net/heensenxi/blog/759319

你可能感兴趣的:(PHP如何查询MySQL数据页面输出内容)