Page 1 of 1

How to solve this vtigercrm code problem???

Posted: Thu Jan 07, 2010 7:49 pm
by 8707
function getProductName($product_id)
{
global $log;
$log->debug("Entering getProductName(".$product_id.") method ...");

$log->info("in getproductname ".$product_id);

global $adb;
$sql = "select productname from vtiger_products where productid=?";
$result = $adb->pquery($sql, array($product_id));
$productname = $adb->query_result($result,0,"productname");
$log->debug("Exiting getProductName method ...");
return $productname;
}

function getTicketDetails($id,$whole_date)
{

$desc .= '<br>System / Application: ' .$whole_date['productname'];
$desc .= "<br>".$mod_strings['Status']." : ".$whole_date['status'];
$desc .= "<br>".$mod_strings['Category']." : ".$whole_date['category'];
$desc .= "<br>".$mod_strings['Severity']." : ".$whole_date['severity'];
$desc .= "<br>".$mod_strings['Priority']." : ".$whole_date['priority'];

return $desc;


}

Output :

System / Application:
Status : Open
Category : Non-Issue
Severity : Enhancement
Priority : Low

I would like to know that how can i call the function getProductName in order to get the product name?
Both function was at same .php file

Re: How to solve this vtigercrm code problem???

Posted: Thu Jan 07, 2010 11:59 pm
by manohoo
Out of curiosity, what's the content of $sql? Please do echo $sql and post the result.