Post by SXGuy » Sat Aug 09, 2014 4:34 pm

Guys, help me out here!

Code: Select all

		$rewards = $this->db->query(" SELECT customer_id, shipping_code FROM `" . DB_PREFIX . "order` WHERE customer_id = '" . (int)$data['customer_id'] . "' AND shipping_code = 'free.free'");
		$previous_rewards = mysql_num_rows($rewards);
Keep getting an error
Warning: mysql_num_rows() expects parameter 1 to be resource
What am I doing wrong?

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Tcalp » Sun Aug 10, 2014 1:17 am

OpenCart has built-in functionality, there is no need to use the num_rows mysql calls.

Code: Select all

$previous_rewards = $rewards->num_rows;

Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite

Image
irc.freenode.net #opencart


User avatar
Active Member

Posts

Joined
Wed Jul 06, 2011 1:49 pm

Post by SXGuy » Sun Aug 10, 2014 1:49 am

Edit: Thank you that fixed the error!

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am
Who is online

Users browsing this forum: No registered users and 57 guests