Hi Perch,
Here's some code snippets using some of our latest library functions:
// add record
$colsToValues = array(); // these fields get automatically mysql escaped unless you end fieldname with =
$colsToValues['createdDate='] = 'NOW()';
$colsToValues['updatedDate='] = 'NOW()';
$colsToValues['createdByUserNum'] = @$CURRENT_USER['num'];
$colsToValues['updatedByUserNum'] = @$CURRENT_USER['num'];
$colsToValues['title'] = @$_REQUEST['title'];
$hideMissingFieldErrors = true;
$newRecordNum = mysql_insert($tablename, $colsToValues, $hideMissingFieldErrors);
// update record
$recordNum = 123; // you can use either or both of $recordNum And $where
$where = null; // lookup by recordNum only
$colsToValues = array(); // these fields get automatically mysql escaped unless you end fieldname with =
$colsToValues['updatedDate='] = 'NOW()';
$colsToValues['updatedByUserNum'] = @$CURRENT_USER['num'];
$colsToValues['title'] = @$_REQUEST['title'];
mysql_update($tablename, $recordNum, $where, $colsToValues);
Hope that helps, cheers!
Dave Edis - Senior Developer
interactivetools.com