Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // enable error checking for development
- ini_set('display_errors',1); // enable php error display for easy trouble shooting
- error_reporting(E_ALL); // set error display to all
- // use standard naming convention
- // example: $result // good
- // $run_query // bad
- $query = "SELECT SUM(REPLACE(CONCAT(`sub_total`), ',', '')) AS total FROM shopping_cart WHERE `user_id` = {$_SESSION['user_id']}";
- $result = mysqli_query($conn,$query) or die(mysqli_error($conn));
- while ($row = mysqli_fetch_assoc($result))
- {
- print_r($row['total']);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement