External key in table
External key in table
Hi , sorry for english i have a datatable with some value tht are external key for example :
<th>N. </th>
<th>Driver</th> //id of external table
<th>Company</th>//id of external table
<th>Customer</th>//id of external table
in normal table (without server side processing) i do this
<?php $driver=$drivers->recupera_da_id($row['id_drivers']) ?><td> <?=$driver->username?></td>
<td>
<?php
$company=$companies->recupera_da_id($row['id_company']);
?>
<?=$company->name ;?>
</td>
<td>
<?php
$customer=$customers->recupera_da_id($row['id_customer']);
?>
<?=$customer->name ;?>
</td>
now in server side this is my culumns:
$columns = array(
array( 'db' => 'numero_corsa', 'dt' => 0 ),
array( 'db' => 'id_drivers', 'dt' => 1 ),
array( 'db' => 'id_company', 'dt' => 2 ),
array( 'db' => 'id_customer', 'dt' => 3 )
);
How can i show instead id_drivers $driver->username
instead id_company $company->name
instead id_customer $customer->name
Answers
Several options:
Allan