正如标题中所提到的,每当我尝试从数据库中获取数据时,我都会收到此错误。
实际上,这些数据来自Sandbox Paypal(IPN MESSAGE),
我想在表格中显示它,但是我无法获得这些数据。
数据:
mc_gross=255.00&protection_eligibility=Eligible&address_status=confirmed&item_number1=&payer_id=Q8XQ4Y9Q53QXW&address_street=1 Main St&payment_date=10:12:23 Apr 27, 2018 PDT&payment_status=Completed&charset=windows-1252&address_zip=95131&mc_shipping=5.00&first_name=firas&mc_fee=7.70&address_country_code=US&address_name=firas jerbi¬ify_version=3.9&custom=52e4d14b5f86928ac956f97dd6accc1f22a27273227b19b7c6c08d2af5e4593d8b99c6bbf7b501b31f586eee32bf7df4311cbb37f97e82f0f793701f67347138mcv2LOikNuxtUksoCAUBjOa3kxbtOWtsi+jTUdhf6QsDqooEgR43s3CyddU9gTWtKtNu34HjtGwGkkza89Tn6w==&payer_status=verified&business=firasmerchant@gmail.com&address_country=United States&num_cart_items=1&address_city=San Jose&verify_sign=AR6P4zSMdK8xkhzWMvTgEQtF6rBEAxyx3ttetekDL89SnCf8Bqbiz.IL&payer_email=firasbuyer@gmail.com&mc_shipping1=5.00&txn_id=3GE77135FE112680G&payment_type=instant&last_name=jerbi&address_state=CA&item_name1=Feuillard plastique et acier&receiver_email=firasmerchant@gmail.com&payment_fee=7.70&quantity1=1&receiver_id=4LS2N7RBPEKD2&txn_type=cart&mc_gross_1=255.00&mc_currency=USD&residence_country=US&test_ipn=1&transaction_subject=&payment_gross=255.00&ipn_track_id=e3f1d75b453a2
ps:付款完成后,我手动输入数据。我尝试了stackoverflow论坛中的每个解决方案,它们都没有为我工作,请帮助!! 谢谢你。
答案 0 :(得分:0)
希望这会对您有所帮助:
使用parse_str
来解析给定的字符串
$string = 'mc_gross=255.00&protection_eligibility=Eligible&address_status=confirmed&item_number1=&payer_id=Q8XQ4Y9Q53QXW&address_street=1 Main St&payment_date=10:12:23 Apr 27, 2018 PDT&payment_status=Completed&charset=windows-1252&address_zip=95131&mc_shipping=5.00&first_name=firas&mc_fee=7.70&address_country_code=US&address_name=firas jerbi¬ify_version=3.9&custom=52e4d14b5f86928ac956f97dd6accc1f22a27273227b19b7c6c08d2af5e4593d8b99c6bbf7b501b31f586eee32bf7df4311cbb37f97e82f0f793701f67347138mcv2LOikNuxtUksoCAUBjOa3kxbtOWtsi+jTUdhf6QsDqooEgR43s3CyddU9gTWtKtNu34HjtGwGkkza89Tn6w==&payer_status=verified&business=firasmerchant@gmail.com&address_country=United States&num_cart_items=1&address_city=San Jose&verify_sign=AR6P4zSMdK8xkhzWMvTgEQtF6rBEAxyx3ttetekDL89SnCf8Bqbiz.IL&payer_email=firasbuyer@gmail.com&mc_shipping1=5.00&txn_id=3GE77135FE112680G&payment_type=instant&last_name=jerbi&address_state=CA&item_name1=Feuillard plastique et acier&receiver_email=firasmerchant@gmail.com&payment_fee=7.70&quantity1=1&receiver_id=4LS2N7RBPEKD2&txn_type=cart&mc_gross_1=255.00&mc_currency=USD&residence_country=US&test_ipn=1&transaction_subject=&payment_gross=255.00&ipn_track_id=e3f1d75b453a2';
parse_str($string, $output);
print_r($output);
$output
生成array
:请参阅工作示例:https://eval.in/999678
在你看来传递它:
$this->load->view('your_view',$output);
在你看来(举个例子):
<table>
<thead>
<tr>
<td>MC Gross</td>
<td>Protection Eligibility</td>
<td>Address Status</td>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $mc_gross;?></td>
<td><?php echo $protection_eligibility;?></td>
<td><?php echo $address_status;?></td>
...........
</tr>
</tbody>
</table>