change:
function insert_personal($personal_id='NULL', $ibf_members_id=$_COOKIE[member_id],
$ntg_places_place_id=$_POST[place_id], $arrival_date=$_POST[arrival_date],
$departing=$_POST[departing], $personals_title=trim($_POST[personals_title]),
$personals_title=$_POST[personals_title], $personals_desc=$_POST[personals_desc],
$date_submitted=now(), $status='0') {
to
function insert_personal($personal_id='NULL', $ibf_members_id=null, $ntg_places_place_id=null, $arrival_date=null,
$departing=null, $personals_title='', $personals_desc='', $date_submitted=null,
$status='0') {
if (is_null($ibf_members_id)) {
$ibf_members_id = $_COOKIE['member_id'];
}
if (is_null($ntg_places_place_id)) {
$ntg_places_place_id = $_POST['place_id'];
}
if (is_null($arrival_date)) {
$arrival_date = $_POST['arrival_date'];
}
if (is_null($departing)) {
$departing = $_POST['departing'];
}
if (strlen($personals_title) == 0) {
if (isset($_POST['personals_title'])) {
$personals_title = trim($_POST['personals_title']);
}
}
if (strlen($personals_desc) == 0) {
if (isset($_POST['personals_desc'])) {
$personals_desc = $_POST['personals_desc'];
}
}
if (is_null($date_submitted)) {
$date_submitted = now();
}
I don't think either PHP4 or PHP5 will work if you use anything other than a number or string as a default argument value (calling functions such as now() or using variables are not allowed, at least not since PHP3).
My workaround above is a bit more coding to do in the function, but still allows you to omit all the arguments if you just want the defaults.
as for $POST[personals_desc] vs. $POST['personals_desc'], always use single or double quotes around the array key, unless you mean to use a constant.
$_POST[personals_desc] works fine until you do:
define("personals_desc", "Default description");
echo $_POST[personals_desc]; // actually echos $_POST["Default description"];
As for the DB stuff, I'm not too familiar with PEAR:😃B so someone else will have to help you with that.
Hope that helps!