tajhay
Well-known member
Hi guys,
following on from this thread https://xenforo.com/community/threa...te-to-display-data-from-a-mysql-query.211452/ i am trying to create a page to display the contents of a SQL Query. When i put the following code in the page, i get the error message when trying to save the page :
Oops! We ran into some problems.
Line 3: Expected valid expression. - Template name: public:_page_node.80:
As soon as i remove the line
it saves successfully - however without giving the results i want. Any assistance would be greatly appreciated.
following on from this thread https://xenforo.com/community/threa...te-to-display-data-from-a-mysql-query.211452/ i am trying to create a page to display the contents of a SQL Query. When i put the following code in the page, i get the error message when trying to save the page :
Oops! We ran into some problems.
Line 3: Expected valid expression. - Template name: public:_page_node.80:
PHP:
<table border=1 cellspacing=1 cellpadding=1>
<tr><th>ID</th><th>Warrior</th><th>Warrior #</th></tr>
<xf:foreach loop="$xf.app.db.fetchAll('SELECT
xf_xa_sc_item.item_id,
xf_xa_sc_item.title,
xf_xa_sc_item_field_value.field_value
FROM
xf_xa_sc_item
JOIN xf_xa_sc_item_field_value ON xf_xa_sc_item.item_id = xf_xa_sc_item_field_value.item_id
WHERE xf_xa_sc_item.category_id in (2,4)
and xf_xa_sc_item_field_value.field_id = 'Warrior_No'
ORDER BY
LENGTH(
xf_xa_sc_item_field_value.field_value
),
xf_xa_sc_item_field_value.field_value;')" value="$row">
<tr>
<td>{$row.item_id}</td>
<td>{$row.title}</td>
<td>{$row.field_value}</td>
</tr>
</xf:foreach>
</table>
As soon as i remove the line
PHP:
and xf_xa_sc_item_field_value.field_id = 'Warrior_No'
Last edited: