Many-to-many relations Minimal theme
Many-to-many (FK) relations can be displayed as simple multiselect fields. This method changes only fk table.
<?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
Customers
| # | Customernumber | Customer orders | City | |
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
| 1 | 103 | 10180 2003-11-11 00:00:00 | Nantes | |
| 2 | 112 | 10100 2003-01-06 00:00:00 | Las Vegas | |
| 3 | 114 | 10100 2003-01-06 00:00:00, 10101 2003-01-09
| Melbourne | |
| 4 | 119 | 10100 2003-01-06 00:00:00, 10101 2003-01-09
| Nantes | |
| 5 | 121 | 10100 2003-01-06 00:00:00, 10101 2003-01-09
| Stavern | |
| 6 | 124 | | San Rafael | |
| 7 | 125 | | Warszawa | |
| 8 | 128 | | Frankfurt | |
| 9 | 129 | | San Francisco | |
| 10 | 131 | | NYC | |