Advertisement Jump to content
Sign in to follow this  
sathenzar

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

This topic is 4931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!