How to solve this vtigercrm code problem???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
8707
Forum Newbie
Posts: 11
Joined: Thu Jan 07, 2010 7:41 pm

How to solve this vtigercrm code problem???

Post 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
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

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

Post by manohoo »

Out of curiosity, what's the content of $sql? Please do echo $sql and post the result.
Post Reply