Editor test - JSON error
Editor test - JSON error
Hello! Just bought the editor, and tried your web interface to quickly genereate a test table and sql database, however after installing I keep getting JSON errors.
http://rafteseth.com/todo/test.html
Could anyone point me in the right direction? I have experience with PHP, but I'm not that good at JS...
Thanks for any help!
Werner
http://rafteseth.com/todo/test.html
Could anyone point me in the right direction? I have experience with PHP, but I'm not that good at JS...
Thanks for any help!
Werner
This discussion has been closed.
Replies
[quote]Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /mounted-storage/home154/sub001/sc16182-ROUK/www/todo/php/table.test.php on line 13[/quote]
Can you post your PHP file?
[code]
<?php
/*
* Editor server script for DB table test
* Automatically generated by http://editor.datatables.net/generator
*/
// DataTables PHP library
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Join,
DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'test' )
->fields(
Field::inst( 'fornavn' )
->validator( 'Validate::required' ),
Field::inst( 'mellomnavn' ),
Field::inst( 'etternavn' )
->validator( 'Validate::required' ),
Field::inst( 'tlf' )
->validator( 'Validate::minMaxLen_required', array('min'=>8, 'max'=>8 ) )
)
->process( $_POST )
->json();
[/code]
Thanks for pointing me in the right direction!
Kind regards
Werner
[code]
<?php
/*
* Editor server script for DB table medlemmer1213
* Automatically generated by http://editor.datatables.net/generator
*/
// DataTables PHP library
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Join,
DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'medlemmer1213' )
->fields(
Field::inst( 'fornavn' )
->validator( 'Validate::required' ),
Field::inst( 'mellomnavn' ),
Field::inst( 'etternavn' )
->validator( 'Validate::required' ),
Field::inst( 'studnr' )
->validator( 'Validate::required' ),
Field::inst( 'telefon' )
->validator( 'Validate::required' ),
Field::inst( 'kjonn' ),
Field::inst( 'sm' ),
Field::inst( 'type' ),
Field::inst( 'utlop' ),
Field::inst( 'frivillig' ),
Field::inst( 'aass' ),
Field::inst( 'stilling' )
)
->process( $_POST )
->json();
[/code]
Can anyone see the problem here? Getting the following errors:
PHP Syntax Check: Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in your code on line 10
PHP Syntax Check: Errors parsing your code
The weird thing is that this almost look exactly the same as my test setup which works.
This setup is located here: http://www.rafteseth.com/test/tables.php
Allan
I'd suggest adding `echo phpversion();` just to make sure that your server is running 5.3.
Allan
Thanks for your help!