Categories | Question details Back To List | ||
get_value of aliased column Hi, I cannot get the value of an aliased column using get_value.. not sure what I'm doing wrong, here is the SQL $GetCalloutsSQL = "select t1.CalloutID, t1.ClientID, t1.JobID, t3.CalloutName as JobCalloutName, t2.TaskDesc, t1.NumberCrew, t1.CalloutDate, t1.ChargeRate, t1.StartTime, t1.NumberHours, t4.lookuptext as COStatus, t1.Location, t5.ContactName from callouts t1, tasks t2, callouttypes t3, lookups t4, contacts t5 where t1.TaskID=t2.TaskID and t1.CallOutTypeID = t3.CalloutTypeID and t1.Status=t4.lookupvalue and t4.lookupkey='calloutstatus' and t1.JobID=$_GET[JobID] and t1.ContactID=t5.ContactID order by CalloutDate, StartTime, TaskDesc asc"; and the render $resconn->render_sql($GetCalloutsSQL,"CalloutID", "NumberCrew,TaskDesc,t3.CalloutName(JobCalloutName),CalloutDate,StartTime,NumberHours,ChargeRate,Location,ContactName,t4.lookuptext(COStatus)"); but using $CalloutType= $action->get_value("JobCalloutName"); returns no value... what is the correct way of getting the value for this aliased column? I have tried various things but none work.. Answer posted by Alex (support) on Dec 11, 2009 05:07 Hello, the $action->get_value("JobCalloutName"); method is called correctly. You can try to enable log to get details: $scheduler->enable_log("log.txt",true); Answer posted by LeitrimMan on Dec 11, 2009 05:23 Hi Alex,
I have tried this, and it still does not update, here is the log - (by the way, what does the error undefined offset mean?)
SELECT contacts.ContactID, contacts.ContactName FROM contacts, jobs WHERE jobs.ClientID=contacts.ClientID and Jobs.JobID=946 Undefined offset: 1 at C:\xampp\htdocs\esionline3\codebase\db_common.php line 207 Undefined offset: 1 at C:\xampp\htdocs\esionline3\codebase\db_common.php line 207 DataProcessor object initialized Row data [4748] Event code for update processed Edit operation finished Done in 0.00554704666138s here is the code to try and update the database from these values...all other fields but CalloutName='$CalloutType', CallOutTypeID=$CalloutType update...
function custom_update($action) Answer posted by LeitrimMan on Dec 11, 2009 05:51 Hi Alex,
yes - heres table structure CREATE TABLE IF NOT EXISTS `callouts` ( Answer posted by Alex (support) on Dec 11, 2009 05:54 According to the log result the JobCalloutName parameter is passed and contains value 2 - JobCalloutName => 2 So, it seems that everything should be ok. |