Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82260

PDOException using ->join

$
0
0
Of course, I could be doing it wrong as this is first time I've attempted to use a Join but I've tried to follow your examples. Seems to be looking for an array where it expects a column.

I'd just like the joined data for display and search, it doesn't need to be actually edited like the primary fields.

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status_reporting.Array' in 'field list'' in /blah/system/dataTables/Database/Driver/Mysql/Query.php:98 

Tables are:

status_reporting (containing field rock_id, which I wish to join to the child's "id" field)
big_rocks (child, keyed on "id")

Code looks like this:

require_once( "../system/dataTables/DataTables.php" );
use
  DataTables\Editor,
  DataTables\Editor\Field,
  DataTables\Editor\Format,
  DataTables\Editor\Join,
  DataTables\Editor\Validate;

  Editor::inst( $db, 'status_reporting' )
  ->field(
    Field::inst( 'action_date' ) ->validator( 'Validate::dateFormat', 'Y-m-d' ),
    Field::inst( 'rock_id' )     ->validator( 'Validate::required' ),
    Field::inst( 'author_id' )   ->validator( 'Validate::required' ),
    Field::inst( 'state' ),
    Field::inst( 'thecomment' )  ->validator( 'Validate::required' )
  )
  ->join(
    Join::inst( 'big_rocks', 'object' )
      ->join( 
          array( 'rock_id', 'id' )  
        )
      ->field( 
          Field::inst( 'team_id' ) 
        )
    )
  ->process( $_POST )
  ->json();

Many thanks for any response, it'd be great to get this working to save me having loads of reference arrays in JavaScript.

Iain

Viewing all articles
Browse latest Browse all 82260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>