I am a bit confused in calculating sum of particular column using mysql.
Database Structure table name: personal there is 25 rows in total, and columns id, userid, name and amount.
I want to calculate amount of particular userid through running session.
Code:
<?php
$userid = $_SESSION['userid'];
$sql = "SELECT userid, SUM(amount) FROM personal";
echo $sql."<br/>";
echo $userid;
?>
Output: SELECT userid, SUM(amount) FROM personal gold99
Please help..guys..