Jump to content

adding up variables *SOLVED*


digitalgod

Recommended Posts

I need to get the sum of 2 query results but it won't let me add them up.

Here's what I have

[code]
<?php
$query = mysql_query("SELECT name FROM list WHERE club = '".$row['club']."' AND date = '".$row['date']."'") or die(mysql_error());
$count_result = mysql_num_rows($query);
$friends_query = mysql_query("SELECT SUM(number) FROM list WHERE club = '".$row['club']."' AND date = '".$row['date']."'") or die(mysql_error());
$friends_count = mysql_fetch_array($friends_query);
$friends_count = $friends_count + $count_result;
?>
[/code]

and I get this error Fatal error: Unsupported operand types.
Link to comment
https://forums.phpfreaks.com/topic/18603-adding-up-variables-solved/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.