marcq
Member
Hi,
I have created a new detail form template.
I'm trying to update data with a query (php form plugin) with the value of a dropdown database join element.
I'm unable to get the id with
I w ould appreciate your support.
Marc
I have created a new detail form template.
I'm trying to update data with a query (php form plugin) with the value of a dropdown database join element.
I'm unable to get the id with
PHP:
$blocationcrew=$data['fab_booking___boarding_location_crew'];[PHP]
Neither with [PHP]$blocationcrew=$data['fab_booking___boarding_location_crew_raw'];[PHP]
Form Plugin PHP
[PHP]
$db = JFactory::getDbo();
// echo "<pre>";print_r($data);exit;
$bookingid=$data['fab_booking___id'];
$bcrewattending=$data['fab_booking___book_crewattending'];
$lcrewend=$data['fab_booking___book_crewend'];
$blocationcrew=$data['fab_booking___boarding_location_crew'];
$llocationcrew=$data['fab_booking___landing_location_crew'];
// var_dump($id);
// var_dump($bcrewattending);
// var_dump($lcrewend);
$query3 = $db->getQuery(true);
$query3 = "UPDATE fab_booking SET book_crewattending = '$bcrewattending' WHERE id = '$bookingid'";
$db->setQuery($query3);
$resultblocationcrew=$db->execute();
$query4 = $db->getQuery(true);
$query4 = "UPDATE fab_booking SET book_crewend = '$lcrewend' WHERE id = '$bookingid' ";
$db->setQuery($query4);
$resultllocationcrew=$db->execute();
$query5 = $db->getQuery(true);
$query5 = "UPDATE fab_booking LEFT JOIN fab_boarding_location_crew ON fab_booking.boarding_location_crew = fab_boarding_location_crew.id SET fab_booking.boarding_location_crew = '$blocationcrew' WHERE (fab_booking.id ='$bookingid'";
$db->setQuery($query5);
$boardinglocationcrew = $db->execute();
$query6 = $db->getQuery(true);
$query6 = "UPDATE fab_booking LEFT JOIN fab_landing_location_crew ON fab_booking.landing_location_crew = fab_landing_location_crew.id SET fab_booking.landing_location_crew = '$llocationcrew' WHERE fab_booking.id = '$bookingid'";
$db->setQuery($query6);
$landinglocationcrew = $db->execute();
I w ould appreciate your support.
Marc