UPDATE problems with PHP
I'm trying to get certain page hit fields in my MySQL table to update if the criteria for two fields are met: campaign_ID = a URL variable and agent_email = another URL variable. Here's the code:
<?php
$result = mysql_query("SELECT * FROM RequestDB");
mysql_query("UPDATE RequestDB SET hits = hits+1 WHERE campaign_ID = $colname_Recordset1 AND agent_email = $colname2_Recordset1");
?>
My code works fine when the bolded/underlined/italicized part of the above code is removed from the code so that it reads:
<?php
$result = mysql_query("SELECT * FROM RequestDB");
mysql_query("UPDATE RequestDB SET hits = hits+1 WHERE campaign_ID = $colname_Recordset1");
?>
But it only updates fields that correspond to the first URL variable. How do I make it so that they correspond to both URL variables? Why isn't the code I'
ve proposed above working?
Thanks!
