use DBI; $user = 'test'; $passwd = 'test2001'; $db = DBI->connect('DBI:mysql:ATMARKIT:localhost', $user, $passwd); $sth = $db->prepare("SELECT id, name, memo FROM list"); $sth->execute; $num_rows = $sth->rows; print "Y $num_rows \n"; for ($i=0; $i<$num_rows; $i++) { @a = $sth->fetchrow_array; print "id=$a[0], name=$a[1] memo=$a[2] \n"; } $sth->finish; $db->disconnect;