在使用asp+access 或asp.net+sql,如需要進(jìn)行統(tǒng)計(jì)或求和等操作,用conn.execute相當(dāng)簡(jiǎn)潔,
例如:
TotalUser=conn.execute("Select count(id) from [MyUser]")(0)
或直接輸入出值<%=conn.execute("Select count(id) from [WebUser]")(0)%>
當(dāng)前PHP中要實(shí)現(xiàn)諸如此類的功能有些繁瑣.需要兩三步.
$result=$conn->query("select count(id) from from MyUser");
$row=$result->fetch_array();
echo $row[0];