Welcome to WebmasterWorld Guest from 107.21.149.142

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

mysql sum with php and pdo

     
12:38 am on Jul 12, 2013 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2010
posts: 167
votes: 0


Could anyone be so kind and tell me how to sum numbers using mysql, php and pdo, I cannot seem to find anything online that will help me.

This is my mysql connection:

<?php $data = $conn->query("SELECT SUM(purchaseAmount) FROM orders WHERE status = 3 AND YEAR(datePaid) = YEAR(CURDATE()) AND MONTH(datePaid) = MONTH(CURDATE())"); ?>


But that's as far as I've gotten.

Thanks.
12:49 am on July 12, 2013 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2010
posts: 167
votes: 0


Oops, I got it, it's the same as regular old PDOless connections, I was drowning in a glass of water :-|

My bad...