输入 :
$sql1 = "SELECT COUNT(*) FROM matchTrip where userTripId = :tripId";
$stmt1 = $this->db->prepare($sql1);
$stmt1->bindParam(':tripId', $trip, PDO::PARAM_INT);
$temp = $stmt1->fetchObject();
echo(json_encode($temp));
输出:
How to take value from array :
of which json_encode looks like this: {"COUNT(*)":"7"}
任何帮助将不胜感激。