PHP5中使用MySQLi扩展的小例子
时间:2021-07-01 10:21:17
帮助过:24人阅读
/** - * mysqli扩展示例
- * by bbs.it-home.org
- */
$mysqli = mysqli_connect("localhost", "root", "","mydatabase", 3306); $result = mysqli_query($mysqli, "SELECT * FROM mytable"); while($row = mysqli_fetch_array($result)) { foreach($row as $key => $value) { - echo "$key = $value\n";
- }
- }
mysqli_free_result($result); - mysqli_close($mysqli);
- ?>
|