PHP/MySQL - error in detection of var test....

Started by
0 comments, last by sathenzar 18 years, 9 months ago
Hey everyone, My paypal IPN is having some problems. It won't detect for some reason when the var contains a certain piece of text. Here's my code:

if(eregi("DRS Music", $item_name)) { echo "1a"; $music = 1; }else{ echo "2a"; $music = 0; }
if($music == 1)
{
  if(!mysql_query("INSERT INTO **********(***, *****, ****, *****) VALUES ('$txn_id', '$payer_email', '$item_name', '$payment_status')", $dbh))
  {
     $sql3 = "INSERT INTO *****(*********) VALUES(mysql_error())";
     mysql_query($sql3, $dbh);
   }
}
else
{
$year  = date("Y");
$month = date("F");
$day   = date("d");
$txn_date = "<year>$year</year><month>$month</month><day>$day</day>";
 if(!mysql_query("INSERT INTO transactions(txn_id, txn_email, txn_date, txn_status, txn_verified) VALUES ('$txn_id', '$payer_email', '$txn_date', '$payment_status', 'VERIFIED')", $dbh))
 {
   $sql3 = "INSERT INTO errors(error_desc) VALUES(mysql_error())";
   mysql_query($sql3, $dbh);
 }
}

Any ideas on why it doesn't work? Thanks in advance.
Advertisement
Maybe I should be more specific, I need it to detect when paypal sends the vars over whether or not the string $item_name contains the word DRS Music in it. It's failing for some reason.

This topic is closed to new replies.

Advertisement