Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何打印以下 Perl 代码片段的结果:
$sth = $dbh->prepare("SELECT * FROM table_name"); $sth->execute();
我想看看如果您在 mySQL 中输入“SELECT * FROM table_name;”并显示整个关系,您会看到什么。是否有来自 $sth 的返回值可以循环并打印出来?
# BIND TABLE COLUMNS TO VARIABLES $sth->bind_columns(undef, \$id, \$product, \$quantity); # LOOP THROUGH RESULTS while($sth->fetch()) { print "$id, $product, $quantity <br />"; }