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