this is a sample code of what I am doing
Code:
<?php
mysql_pconnect("*****","*****","*******");
mysql_select_db("Clan");
$Tstrength = mysql_query("SELECT m.clan, SUM(m.strength) FROM
members m, clan c WHERE c.id = 1 AND m.clan = 1 Group By m.strength");
while ($row = mysql_fetch_array($Tstrength))
{
print" Strength: $row[1]";
}
?>
this works great, prints exactly what I want on the screen
BUT, I want to make the
Code:
WHERE c.id = 1 AND m.clan = 1
not constant. I need it to be a variable since there are many clans
I tried this
Code:
WHERE c.id =$clan[id] AND m.clan =$clan[id]
but every time I put any sort of variable inplace of the constant I get this error
Quote:
|
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site55/fst/var/www/html/game/clan.php on line 163
|
anyone have any ideas?
if some one thinks they might have the knowledge to help I can share with them the actuall source code, which as you can see is a few hundred lines.
thanks for any help that can be given