Quote:
Originally Posted by tightjeansforum
I get an error when I try to buy any item.
Just got this one trying to buy an item I made myself.
Fatal error: Cannot use object of type mysqli_result as array in /usr/home/jappleton/domains/tightjeansforum.com/public_html/pointmarket/market_store_purchase.php on line 30
|
I'm getting the same error
TheMayham, please help us...
Edit:
I was able to fix the bug by myself.
For the other guys encountering the same problem:
1. open /pointmarket/market_store_purchases.php
2. search for
Code:
$cid = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_coupons WHERE id ='$getcoupon'");
- should be around line 25
3. replace it with
Code:
$cid = $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_coupons WHERE id ='$getcoupon'"));
4. search for
Code:
$cid = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_coupons WHERE id='$getcoupon'");
Approx. Line 31
5. replace with
Code:
$cid = $vbulletin->db->fetch_array($db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_coupons WHERE id='$getcoupon'"));
After this modification I was able to buy products
Question to Mayham:
shouldn't
Code:
$has_purchased = $db->num_rows($db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_store_transactions
where userid='$userid' AND coupon='$cid[id]'"));
be changed to
Code:
$has_purchased = $vbulletin->db->num_rows($db->query_read("SELECT * FROM " . TABLE_PREFIX . "market_store_transactions
where userid='$userid' AND coupon='$cid[id]'"));
as well?
Best regards
Kesandal