Counter problem!
Posted: Mon Jan 25, 2010 1:29 pm
Hey php technorati. I have another problem. I am trying to create a counter that conforms to certain values that are present in the fields of a mysql db. here is my code:
I need it to count every row that has those specific variables.But I am getting a error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
Please advise captain!!!!
Thanks in advance,
Batoe
Code: Select all
$query = "SELECT month, pay_type FROM js_login WHERE agentID='$_SESSION['agent_login']['agentID']' AND month= 'January' And pay_type= 'p1'";
$result = mysql_query($query) or die(mysql_error());
$count = '0';
while($row = mysql_fetch_assoc($result))
{
$count ++;
}
echo "$count";
mysql_close();
?>Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
Please advise captain!!!!
Thanks in advance,
Batoe