Sorry Patrick, same error
Also no SQL query output when Output checked, same error message, nothing else
It’s just a testbed i set up for this using SQLite so i could zip the entire site for you if that would help
Here is the API action content :
<?php
require('../../dmxConnectLib/dmxConnect.php');
$app = new \lib\App();
$app->define(<<<'JSON'
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "db",
"sql": {
"type": "SELECT",
"columns": [
{
"table": "invoices",
"column": "invoice_number"
},
{
"table": "invoices",
"column": "client_id"
}
],
"table": {
"name": "invoice",
"alias": "invoices"
},
"primary": "invoice_id",
"joins": [],
"sub": {
"items": {
"type": "SELECT",
"table": {
"name": "invoice_items",
"alias": "items"
},
"key": "invoice_id",
"columns": [
{
"table": "items",
"column": "quantity"
},
{
"table": "items",
"column": "product_id"
}
],
"primary": "item_id",
"joins": [
{
"table": "products",
"column": "*",
"alias": "product",
"type": "INNER",
"clauses": {
"condition": "AND",
"rules": [
{
"table": "product",
"column": "product_id",
"operator": "equal",
"value": {
"table": "items",
"column": "product_id"
},
"operation": "="
}
]
},
"primary": "product_id"
}
],
"query": "SELECT items.quantity, items.product_id\nFROM invoice_items AS items\nINNER JOIN products AS product ON (product.product_id = items.product_id)",
"params": []
}
},
"wheres": {
"condition": "AND",
"rules": [
{
"id": "invoices.invoice_id",
"field": "invoices.invoice_id",
"type": "double",
"operator": "equal",
"value": 1,
"data": {
"table": "invoices",
"column": "invoice_id",
"type": "number",
"columnObj": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false,
"name": "invoice_id"
}
},
"operation": "="
}
],
"conditional": null,
"valid": true
},
"query": "SELECT invoice_number, client_id\nFROM invoice AS invoices\nWHERE invoice_id = 1",
"params": []
},
"test": true
},
"output": true,
"meta": [
{
"type": "number",
"name": "invoice_number"
},
{
"type": "text",
"name": "client_id"
},
{
"name": "items",
"type": "array",
"sub": [
{
"type": "text",
"name": "quantity"
},
{
"type": "number",
"name": "product_id"
}
]
}
],
"outputType": "array"
}
}
}
JSON
);
?>