1

我的桌子是这样的:

+----------+-----------+
| ind_type | Index_val |
+----------+-----------+
| pcount   |         7 |
| ncount   |        15 |
+----------+-----------+

我想获得 pcount 和 ncount 的值:

这有什么问题:

$p= $mysqli->query('SELECT Index_val FROM view_name where ind_type='pcount'');
   echo "$p";
4

2 回答 2

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;
}
于 2013-09-19T13:22:58.230 回答
0
$p= $mysqli->query("SELECT Index_val FROM view_name where ind_type='pcount'");
   while ($obj = $p->fetch_object()){echo $obj->Index_val;}

//用这个

于 2013-09-19T13:28:49.737 回答