You are not logged in.
Pages: 1
Hi
I'm trying to generate a consult by id on Reports Plugins...
I have this code:
<?php
$USEDBREPLICATE= 1;
$DBCONNECION_REQUIRED= 0;
include ("../../../../inc/includes.php");
//TRANS: PRUEBA
include_once 'cons.en_GB.php';
$report = new PluginReportsAutoReport($LANG['plugin_reports']['cons']);
//new PluginReportsDateIntervalCriteria($report, "`glpi_logs`.`date_mod`");
new PluginReportsTextCriteria($report, 'id', __('ID'));
$report->displayCriteriasForm();
// Declare columns
if($report->criteriasValidated()) {
$itemtype = $_POST['itemtype'];
$table = getTableForItemType($itemtype);
$report->setColumns(array(
new PluginReportsColumn('name', __('Nombre')),
new PluginReportsColumn('id', __('ID')),
));
$query = "SELECT `name`,`id` from `glpi_tickets` WHERE `id` " .$report->addSqlCriteriasRestriction() ;
$report->setSqlRequest($query);
$report->execute();
}
?>
This code work's fine, but the results of query are not what I want.
The query shows me those tickets where the id is the id number that I put to find
Example, if I put 1 in the search shows me all IDs that have the number 1: 1, 10, 11, 21, 31 ...
What should I do to make it an exact query?
Please help! Thanks
Offline
Pages: 1