我有一个页面,所有现在正在我唯一的问题是ciunying从DATABSE记录功能..PDO计数不工作
Class.user.php
Public function data($count)
{
$stmt=$this->db->prepare("SELECT COUNT(*) FROM login");
$result=$this->db->prepare($count);
$result->execute();
$number_of_rows=$result->fetchColumn();
}
的index.php
<table>
<thead>
<tr>
<th>2014</th>
</tr>
</thead>
<tbody>
<?php
$count="SELECT COUNT(*) FROM login";
$crud->data($count);
?>
的问题在于,其不表示计数..
'SELCT'和'CIUNT'在您的'index.php'中都拼写错误。你的功能是奇怪的,没有意义 - 为什么你准备两个不同的语句,只执行一个? – ceejayoz
林对不起,它只是一个错字 – kier
你既不输出也不返回任何点的计数值。所以,是的,计数将不会显示。 – deceze