Made PDO connection successfully but arrays empty
Made PDO connection successfully but arrays empty
So I believe I have made a successful PDO connection to MSSQL server but when I run the following I get empty arrays:
Editor::inst( $db, 'ALLPRODUCTS', 'nseq' )
->fields(
Field::inst( 'citemno' ),
Field::inst( 'cdescript' ),
Field::inst( 'cmanufacturer' ),
Field::inst( 'cproducttype1' ),
Field::inst( 'cproducttype2' ),
Field::inst( 'quantity' ),
Field::inst( 'cuom' ),
Field::inst( 'price' ),
Field::inst( 'subtotal' )
)
->process( $_POST )
->json();
Response: {"data":[],"options":[],"files":[]}
Answers
Check again the connection with the database, table name and if any error.log appeared on the server.
If you get a response like that, then it suggests that the
ALLPRODUCTS
table on the connected database is empty.If there was a connection error, then it would give such an error. Can you confirm you are connecting to a database with data in that table by querying it directly?
Perhaps try:
Allan