The1LT
Member
Hi guys,
Doing my first mod for an add on and as luck would have it, the code executes after the paypal callback and I can't figure out how to debug it with eclipse since it doesn't seem to pass off to paypal and return while in debug mode.
So basically I'm coding/learning blind.
Just a simple question:
Does the fetchRow function only return a single row when it's executed? This statement I've put together above I just want the last unused Licence entry to be returned. I had assumed that fetchRow was the same as a direct read or a chain and will only return the first it finds based on the params but when running it I'm getting some strange results as if it's picking up more than one row.
So I looked around a bit further and found this type of statement:
So what would be the difference between a fetchRow and fetchOne?
Again apologies for the basic question, i can't for the life of me get the debugger up on this one.
Ross
Doing my first mod for an add on and as luck would have it, the code executes after the paypal callback and I can't figure out how to debug it with eclipse since it doesn't seem to pass off to paypal and return while in debug mode.
So basically I'm coding/learning blind.
Just a simple question:
Code:
//get licence from table instead of randomly generating from helper class above
$used = 0;
$row = $this->_getDb()->fetchRow("SELECT * FROM `gfnpm_license_import` WHERE Used = ? ORDER BY LicenceID", $used);
$newLicense = $row['LicenceKey'];
Does the fetchRow function only return a single row when it's executed? This statement I've put together above I just want the last unused Licence entry to be returned. I had assumed that fetchRow was the same as a direct read or a chain and will only return the first it finds based on the params but when running it I'm getting some strange results as if it's picking up more than one row.
So I looked around a bit further and found this type of statement:
Code:
return $this->_getDb()->fetchOne('
SELECT COUNT(*)
FROM xf_conversation_user AS conversation_user
INNER JOIN xf_conversation_master AS conversation_master ON
(conversation_user.conversation_id = conversation_master.conversation_id)
INNER JOIN xf_conversation_recipient AS conversation_recipient ON
(conversation_user.conversation_id = conversation_recipient.conversation_id
AND conversation_user.owner_user_id = conversation_recipient.user_id)
' . $sqlClauses['joinTables'] . '
WHERE conversation_user.owner_user_id = ?
AND ' . $whereClause
, $userId);
So what would be the difference between a fetchRow and fetchOne?
Again apologies for the basic question, i can't for the life of me get the debugger up on this one.
Ross