Is it possible to use a sql query instead of a table in a server script?
Is it possible to use a sql query instead of a table in a server script?
Hildeb67
Posts: 65Questions: 19Answers: 1
Is this possible?
$sql_query = 'SELECT * USER WHERE NAME LIKE 'Pe%' ';
Editor::inst( $db, $sql_query,Index)
->fields( .............................
This question has an accepted answers - jump to answer
Answers
It isn't. At least not like that. If you just want a condition for
NAME LIKE 'Pe%'
then use thewhere
method:In a more general sense though, if you wanted 100% custom SQL statements to drive the table, that isn't possible with the Editor PHP libraries, since for that to work, they would need to have the ability to parse SQL! Instead, the API is used to build up the SQL statements for all four CRUD actions.
You can of course query the db directly and populate a table that way. You can also handle the submit data if you wanted to go 100% custom at the server-side. But the Editor API cannot accept just any SQL statement.
Allan
Thank you for this Answer