6
Off topic not a problem (work great by the way, THANKS!)
Function of ticket object:
--------------------------
function getTicketUpdateUID( $TicketID )
{
global $xoopsDB;
$ret = array();
$query_table = $xoopsDB->prefix('obsclient_tt_ticketdata');
$sql = "SELECT UpdateUID FROM $query_table WHERE TicketID = $TicketID";
$result = $xoopsDB->query($sql);
$myrow = $xoopsDB->fetchArray($result);
$ret = $myrow['UpdateUID'];
if( $ret == "" )
{
$ret = "Unknown";
}
return $ret;
}
Table:
------
#
# Table structure for table `obsclient_tt_ticketdata`
#
CREATE TABLE obsclient_tt_ticketdata (
TicketID int(10) NOT NULL auto_increment,
UID int(10) NOT NULL default '0',
StatusID int(10) NOT NULL default '0',
ClientID int(10) NOT NULL default '0',
CategoryID int(10) NOT NULL default '0',
EntryDate date NOT NULL default '0000-00-00',
TicketHours decimal(10,1) NOT NULL default '0',
TicketDetails text NOT NULL default '',
UpdateDate date NOT NULL default '0000-00-00',
UpdateUID int(10) NOT NULL default '0',
PRIMARY KEY (TicketID)
) TYPE=MyISAM;
As you can see, I am retrieving the ID of the last person to update a particular ticket. Therefore, the ticket ID is needed as it is the primary key of the ticket table, and the only unique identifier of the ticket object.
Make sense? Wrong way to do this?
JMass