one query - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of one query.php
- <?php
- $sqllist = $db->query(" SELECT * FROM `{$db_cart}` WHERE order_userid={$usr["id"]} && order_status='new' ");
- $cart = $sqllist->fetchAll();
- $cart_count = $sqllist->rowCount();
- $total = array();
- foreach ($cart as $v) {
- $total[] = $v["order_cost"];
- }
- $data["count"] = $cart_count;
- $data["total"] = array_sum($total);
- print json_encode($data);
File Description
- one query
- PHP Code
- 07 Jul-2021
- 391 Bytes
You can Share it:
Latest PHP Pastes