Query Execution
Permalink
I am unable to execute the query due to the template value (<%=file.fID%>)
i am getting a number but while printing it shows an empty array
<script type="text/template" data-template="search-results-table-body">
<% _.each(items, function (file) {%>
<tr data-launch-search-menu="<%=file.fID%>" data-file-manager-file="<%=file.fID%>">
</script>
<%=file.fID%> comes from the above code
$db= Loader::db();
$query="SELECT * FROM `FileStatus` WHERE `fID`="."'<%=file.fID%>'";
$rs = $db->GetAll($query);
print_r($rs);
i am getting a number but while printing it shows an empty array
<script type="text/template" data-template="search-results-table-body">
<% _.each(items, function (file) {%>
<tr data-launch-search-menu="<%=file.fID%>" data-file-manager-file="<%=file.fID%>">
</script>
<%=file.fID%> comes from the above code
$db= Loader::db();
$query="SELECT * FROM `FileStatus` WHERE `fID`="."'<%=file.fID%>'";
$rs = $db->GetAll($query);
print_r($rs);
You can understand the whole code if you look into this page
\concrete\elements\files\search.php
this is the file manager page .
so we are getting each File ID value in (<%=file.fID%>) this is not a php code it is some javascript tempelate code i want this value in php and run my query
\concrete\elements\files\search.php
this is the file manager page .
so we are getting each File ID value in (<%=file.fID%>) this is not a php code it is some javascript tempelate code i want this value in php and run my query
Instead of:
use something like this (assuming $fID has been sanitized)::
<?php echo $fID; ?> will most likely return true, meaning the echo was successful, but not what you want in a query.