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

Equivalent Timestamp Query from SQL to PHP Datatable file

$
0
0

I've got some sql code that I run to get a timestamp to equal the curdate()

SELECT tbl_customers.prin, tbl_customers.cust_loaded, tbl_customers.technician...
FROM tbl_customers
WHERE c_status = 1 and DATE(cust_loaded) = curdate()

this runs fine
but I'm trying to get the equivalent in my php file to populate my datatable

Editor::inst( $db, 'tbl_customers', 'id' )
    ->fields(
        Field::inst( 'corder' ),
        Field::inst( 'acct' ),
        Field::inst( 'name' ),
        Field::inst( 'hse' ),
        Field::inst( 'street' ),
        Field::inst( 'city' ),
        Field::inst( 'st' ),
        Field::inst( 'zip' )
    )
    ->where('technician', $_SESSION['svEmpID'])
    ->where('c_status', 1)
    ->where( 'DATE(cust_loaded)' , 'curdate()')
    ->process( $_POST )
    ->json();

I get an error unless I comment out
->where( 'DATE(cust_loaded)' , 'curdate()')

Is this a limitation with datatables or is there something I'm missing.

TIA


Viewing all articles
Browse latest Browse all 82387

Trending Articles



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