PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Assuming that somewhere between there, you actually call the function, then the problem is in your function.
What is f('hits')?
What is the f() function and what does it do?
Where is the query() function defined?
And how come you haven't run the query you created, let alone use any data from its results?
What is actually going wrong?
$q = mysql_query("SELECT hits FROM sponsor WHERE sponsor_id='$sponsor_b_id'");
if (!$q)
return false;
mysql_query("UPDATE sponsor SET hits=hits+1 WHERE sponsor_id='$sponsor_b_id'");