2

I have upgraded my app MySql_* to MySqli_* most of the things work well but i am lost in this. Its code from PayPal IPN with PHP from this website: http://www.micahcarrick.com/paypal-ipn-with-php.html

$txn_id = mysql_real_escape_string($_POST['txn_id']);
$sql = "SELECT COUNT(*) FROM orders WHERE txn_id = '$txn_id'";
$r = mysql_query($sql);

if (!$r) {
    error_log(mysql_error());
    exit(0);
}

$exists = mysql_result($r, 0);
mysql_free_result($r);

I have done all converting but i am lost how to write this part: this two lines are headache for me right now only this two. can any one tell how i can write this lines?

$exists = mysql_result($r, 0);
mysql_free_result($r);

Thanks all

SheetJS
  • 22,470
  • 12
  • 65
  • 75
deerox
  • 1,045
  • 3
  • 14
  • 28
  • 1
    @YourCommonSense you should identify the duplicate next time (and also actually vote to close) – SheetJS Oct 21 '13 at 05:17

0 Answers0