在MySQL中显示所有记录

在MySQL中显示所有记录,mysql,perl,filter,Mysql,Perl,Filter,我试图显示MySQL表中的所有记录 我可以做select*from table,但这不是我想要做的 我想做这样的事情 select app_id, app_name from app where app_sendto = '%' 我尝试了上面的方法,但没有显示任何内容 我想按如下方式运行上述查询 $get_app = "select app_id, app_name from app where app_sendto = ?"; $sth = $dbh->prepare($get_app

我试图显示MySQL表中的所有记录

我可以做
select*from table
,但这不是我想要做的

我想做这样的事情

select app_id, app_name from app where app_sendto = '%'
我尝试了上面的方法,但没有显示任何内容

我想按如下方式运行上述查询

$get_app = "select app_id, app_name from app where app_sendto = ?";
$sth = $dbh->prepare($get_app); 
$sth->execute('people') or die "Cannot execute sth: $DBI::errstr";

谁能帮我一下吗。

刚刚得到解决方案,查询应该是

select app_id, app_name from app where app_sendto like '%'

您好@Mat谢谢,我刚刚发现了问题所在:应该选择app_id,app_name from app where app_send to like“%”我想做的是获取特定校园的所有应用程序。用户只能查看自己的校园应用程序。例如:基里巴斯校区将有一个查询
$get_app=“从app_sendto=?”的app中选择app_id,app_name”$sth=$dbh->prepare($get\u app)$sth->execute('Kiribati')或die“无法执行sth:$DBI::errstr”现在它对我来说很好,我可以只显示基里巴斯校园的应用程序。