我的表是这样的:
+----------+-----------+
| ind_type | Index_val |
+----------+-----------+
| pcount | 7 |
| ncount | 15 |
+----------+-----------+
我想得到count和noncount的值:
这有什么问题:
$p= $mysqli->query('SELECT Index_val FROM view_name where ind_type='pcount'');
echo "$p";
答案 0 :(得分:0)
$query = mysqli->query("SELECT * FROM db WHERE a = 'bob'");
foreach ($query->fetch_object() as $row) {
echo $row->column1;
echo $row->column2;
echo $row->column3;
}
答案 1 :(得分:0)
$p= $mysqli->query("SELECT Index_val FROM view_name where ind_type='pcount'");
while ($obj = $p->fetch_object()){echo $obj->Index_val;}
//使用此