if (!($cn = mysqli_connect("localhost", "hoge", "hoge"))) {
die;
}
if (!(mysqli_select_db($cn,"test"))) {
die;
}
$sql = "select * from address";
if (!($rs = mysqli_query($cn,$sql))) {
die;
}
$i=0;
while ($item = mysqli_fetch_array($rs)) {
print "${item['id']} ";
print "${item['name']} ";
print "
";
$data[$i]['name']= $item['name'];
$data[$i]['tel']= $item['tel'];
$i++;
}
mysqli_close($cn);
No comments:
Post a Comment