DEMO SITE v1.7.15

Many-to-many relations Bootstrap 4.5 theme

Many-to-many (FK) relations can be displayed as simple multiselect fields. This method changes only fk table.

HIDE CODE
<?php
	$xcrud = Xcrud::get_instance();
    $xcrud->table('customers');
    $xcrud->columns('customerNumber,Customer orders,city');
    $xcrud->fk_relation('Customer orders','customerNumber','customers_orders_fk','customer_id','order_id','orders','orderNumber',array('orderNumber','orderDate'));
    echo $xcrud->render();
?>

Customers

#CustomernumberCustomer ordersCity 
111910103 2003-01-29 00:00:00, 10104 2003-01-31…Nantes
212110103 2003-01-29 00:00:00, 10104 2003-01-31…Stavern
312410437 0000-00-00 00:00:00, 10438 0000-00-00…San Rafael
4125Warszawa
5128Frankfurt
6129San Francisco
7131NYC
8141Madrid
9144Luleå
10145Kobenhavn
Search