+
Skip to content

this error LEFT JOIN #13

@xoceunder

Description

@xoceunder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载