Okay so basically I have an if statement that is checking to see if a variable $numEntries is less than another variable that i know is set to 100. The $numEntries variable is set equal to a query that sums a column in a table in my database. To make this easier to visualize I scaled it down into a test code:
<?php
$connect =mysql_connect("localhost","root"."");
mysql_select_db("2")
$numEntries=mysql_query("SELECT Sum(ALL('MoosSpent')) FROM entries");
if($numEntries<100)
{
echo "hi";
}
else
{
echo "Bye";
}
?>
In that mini test code I am expecting to receive an echo of "Hi" but instead receive bye. I have ran the query that defines the $numEntries variable through the phpMyadmin code screen and it returns the the value which is over 100.
When I try to echo the $numEntries variable I get a resource Id also.
Any suggestions?
Also I had this block of code working in its entirity until I added a larger if statement around it. But whats weird is even with the new if statement taken out it still doesn't work or in the test code for that matter.
<?php
$connect =mysql_connect("localhost","root"."");
mysql_select_db("2")
$numEntries=mysql_query("SELECT Sum(ALL('MoosSpent')) FROM entries");
if($numEntries<100)
{
echo "hi";
}
else
{
echo "Bye";
}
?>
In that mini test code I am expecting to receive an echo of "Hi" but instead receive bye. I have ran the query that defines the $numEntries variable through the phpMyadmin code screen and it returns the the value which is over 100.
When I try to echo the $numEntries variable I get a resource Id also.
Any suggestions?
Also I had this block of code working in its entirity until I added a larger if statement around it. But whats weird is even with the new if statement taken out it still doesn't work or in the test code for that matter.