We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work
<?php // DB table to use $table = 'usuario_vod'; // Table's primary key $primaryKey = 'cve'; $columns = array( array( 'db' => '`u`.`user`', 'dt' => 0, 'field' => 'user', 'as' => 'user' ), array( 'db' => '`u`.`contrasenia`', 'dt' => 1, 'field' => 'contrasenia' ), array( 'db' => '`u`.`pin`', 'dt' => 2, 'field' => 'pin' ), array( 'db' => '`u`.`status`', 'dt' => 3, 'field' => 'status'), array( 'db' => '`ud`.`user`', 'dt' => 4, 'field' => 'user', 'as' => 'user' ), array( 'db' => '`u`.`fecha_vencimiento`', 'dt' => 5, 'field' => 'fecha_vencimiento', 'formatter' => function( $d, $row ) { return date( 'd-M-Y', strtotime($d)); }), array('db' => '`u`.`idu_dispositivo`', 'dt' => 6, 'field' => 'idu_dispositivo'), array('db' => '`u`.`idu_dispositivo`', 'dt' => 7, 'field' => 'idu_dispositivo') ); // SQL server connection information require('config.php'); $sql_details = array( 'user' => $db_username, 'pass' => $db_password, 'db' => $db_name, 'host' => $db_host ); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * If you just want to use the basic configuration for DataTables with PHP * server-side, there is no need to edit below this line. */ // require( 'ssp.class.php' ); require('ssp.customized.class.php' ); $joinQuery = "FROM `usuario_vod` AS `u` JOIN `usuario` AS `ud` ON (`ud`.`cve` = `u`.`cve_dealer`)"; $extraWhere = ""; echo json_encode( SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns, $joinQuery, $extraWhere ) );
In the user fields I throw the same data since they use the same field the 2 tables
The text was updated successfully, but these errors were encountered:
Replace Line 53 of ssp.customized.class.php Original: $row[ $column['dt'] ] = ($isJoin) ? $data[$i][ $columns[$j]['field'] ] : $data[$i][ $columns[$j]['db'] ]; Replace With: $row[ $column['dt'] ] = ($isJoin) ? (isset($columns[$j]['as']) ? $data[$i][ $columns[$j]['as'] ] : $data[$i][ $columns[$j]['field'] ]) : $data[$i][ $columns[$j]['db'] ];
$row[ $column['dt'] ] = ($isJoin) ? $data[$i][ $columns[$j]['field'] ] : $data[$i][ $columns[$j]['db'] ];
$row[ $column['dt'] ] = ($isJoin) ? (isset($columns[$j]['as']) ? $data[$i][ $columns[$j]['as'] ] : $data[$i][ $columns[$j]['field'] ]) : $data[$i][ $columns[$j]['db'] ];
Sorry, something went wrong.
It would be better, if you can share your ERROR as well.
Thanks
No branches or pull requests
Does not work
In the user fields I throw the same data since they use the same field the 2 tables
The text was updated successfully, but these errors were encountered: