且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从Mysql数据库创建和填充php数组

更新时间:2022-11-25 13:49:03

RTM

示例 #1 获取结果集中所有剩余的行

<?php
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
$sth->execute();

/* Fetch all of the remaining rows in the result set */
print("Fetch all of the remaining rows in the result set:\n");
$result = $sth->fetchAll();
print_r($result);
?>