problem with inserting data in two tables using one form in workflow
I m using galaxia workflow. i want to insert data in two tables using one form.
details are:
i have two tables tour and tour_details and tour table i m onserting some value and in other table i m inserting more value but the value in tour_details is not insering
code is
text
<?php
if 'fname'" class="wiki wikinew text-danger tips">isset($_REQUEST'fname' and 'forward'" class="wiki wikinew text-danger tips isset">$_REQUEST'forward') {
$fname = $_REQUEST'fname';
$instance->set('fname', $fname);
$purpose = $_REQUEST'purpose';
$instance->set('purpose', $purpose);
$reasons = $_REQUEST'reasons';
$instance->set('reasons', $reasons);
$advanced = $_REQUEST'advanced';
$instance->set('advanced', $advanced);
$comp_code = $_REQUEST'comp_code';
$instance->set('comp_code', $comp_code);
$dep_date = $_REQUEST'dep_date';
$instance->set('dep_date', $dep_date);
$dep_time = $_REQUEST'dep_time';
$instance->set('dep_time', $dep_time);
$origin = $_REQUEST'origin';
$instance->set('origin', $origin);
$arr_date = $_REQUEST'arr_date';
$instance->set('arr_date', $arr_date);
$arr_time = $_REQUEST'arr_time';
$instance->set('arr_time', $arr_time);
$dest = $_REQUEST'dest';
$instance->set('dest', $dest);
$mode = $_REQUEST'mode';
$instance->set('mode', $mode);
$address = $_REQUEST'address';
$instance->set('address', $address);
$query = "insert into tour(fname, purpose, reasons, advanced, comp_code ) values ('$fname', '$purpose', '$reasons', '$advanced', '$comp_code')";
$tikilib->query($query);
$query = "select LAST_INSERT_ID()";
$cursor = $tikilib->query($query);
$result = $cursor->fetchRow(DB_FETCHMODE_ASSOC);
$instance->set('tourId', $result'LAST_INSERT_ID()');
$query1 = "insert into tour_details(dep_date, dep_time, origin, dest, arr_date, arr_time, mode, address ) values ('$dep_date', '$dep_time', '$origin', '$dest', '$arr_date', '$arr_time', '$mode', '$address')";
$tikilib->query($query1);
$query1 = "select LAST_INSERT_ID()";
$cursor = $tikilib->query($query1);
$result = $cursor->fetchRow(DB_FETCHMODE_ASSOC);
$instance->set('tourId', $result'LAST_INSERT_ID()');
$instance->complete();
}
text
where tourId is primary for tour table and srno is primary key for tour_details
tuorId is also foreign key in tour_details table...
where is the error please send me as early as possible thanks