[FX.php List] Memories....MORE
Jonathan Schwartz
jschwartz at exit445.com
Wed May 12 13:48:40 MDT 2010
OK. How about a gentle push in the right direction? It's a big jump
from example code to doing creating a function for an entire query,
using a dozen or so variables.
Here is my log.php query "add" code using the API. Do I need to
define every variable in the function definition? What about the
first two lines that contain includes?
Existing Log Code:
require_once('Connections/log_prefs.php');
require_once('FileMaker.php');
$log_add = $log->newAddCommand('web');
$log_add_fields = array(
'DB'=>'ABCD',
'IP'=> $IP,
'Browser'=> $AGENT,
'hostname'=> $_SESSION['hostname'],
'sessionid'=> $sessionid,
'Location'=> $_SERVER['PHP_SELF'],
'Step'=>$Step,
'Detail'=> $Detail,
'Name'=> $Name,
'ZipCode'=>$Zip,
'Route'=>$Route,
'Message'=>$Message,
'mode'=>$_SESSION['loginmode'],
'type'=>$_SESSION['type'],
'elapsed'=>$timeelapsed,
'CustID'=>$_SESSION['Customer_ID_Number'],
'Rep'=>$_SESSION['LastName'],
'users'=>$_SESSION['OnlineUsers'],
'Region'=>$_SESSION['Region'],
'referer'=>$referer,
'CustTempRecID'=>$TempRecID
);
foreach($log_add_fields as $key=>$value)
{
$log_add->setField($key,$value);
}
$log_add_results= $log_add->execute();
if(FileMaker::isError($log_add_results))
{
$error_code = $log_add_results->code;
exit;
}else{
$log_row =
current($log_add_results->getRecords());
}
Thanks for the help.
Jonathan
--
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-370-5011
More information about the FX.php_List
mailing list