i am trying to add up some records from a table, however, it isn't working properly, i.e. when i try var_dump to see what the value is showing i just get string(0) ""
Here is the code
$current_wealth1 = mysql_query("SELECT SUM(estimated_wealth) as total_house_wealth FROM user_houses WHERE user_id='$user_id'");
var_dump($total_house_wealth);
$current_wealth = $ved_balance + $total_house_wealth;
In terms of output, i am just using conventional php print to output $current_wealth.
Any ideas, what could be the problem?
EDIT: Here is my current code, getting a syntax error on the second line
$current_wealth1 = mysql_query("SELECT SUM(estimated_wealth) as total_house_wealth FROM user_houses WHERE user_id='$user_id'");
$total_house_wealth = mysql_fetch_array($current_wealth1)[0];
$current_wealth = $ved_balance + $total_house_wealth;
mysql_querydoesn't work like that. just read the manual please, and take the RED HINTS about pdo/msqli to heart: php.net/manual/en/function.mysql-query.php