Empty table

Display an empty table in ChronoForms before a search.

Overview

The table shows no results initially because the WHERE clause returns records even without search criteria.
Modify the WHERE clause to check if search values are set. If no search is performed, use a condition that returns no records, such as '1 = 2'.

Answered
Po Popkorn 17 Jun, 2014
Hey guys
how I can show the ccv table without results? And when i click the search button show the data?
Thanks for all
Gr GreyHead 17 Jun, 2014
Hi PopKorn,

You set the WHERE setting to show the empty list if there is no search set. Essentially you want to check for your search value and, if that isn't set make the WHERE clause return no records by setting it to say WHERE 1 = 2

Bob
Po Popkorn 17 Jun, 2014
Hi bob.
Thanks for this fast reply
I have this in WHERE SQL

<?php
$title = JRequest::getString('title', '', 'post');
$pepito= JRequest::getString('otro', '', 'post');
$nom= JRequest::getString('nom', '', 'post');
$fecha= JRequest::getString('fecha', '', 'post');
$esta= JRequest::getString('esta', '', 'post');
if ( $pepito ) {
echo " `cf_objeto` LIKE '%$title%' and `cf_tienda` LIKE '%$pepito%' and `cf_fecha` LIKE '%$fecha%' and `cf_nombre` LIKE '%$nom%' and `input_checkbox_group_11` LIKE '%$esta%'    ";
}
?>

Can you show me how i do this?Today I can not get anything to work
Thanks
Gr GreyHead 17 Jun, 2014
Answer
1 Likes
Hi Popkorn,

. . .
if ( $pepito ) {
  echo " `cf_objeto` LIKE '%$title%' and `cf_tienda` LIKE '%$pepito%' and `cf_fecha` LIKE '%$fecha%' and `cf_nombre` LIKE '%$nom%' and `input_checkbox_group_11` LIKE '%$esta%'    ";
} else {
  echo ' 1 = 2 ';
}
Po Popkorn 17 Jun, 2014
Thaaaaaaaaaaaaaaaaanks for all bob😀:D
This topic is locked and no more replies can be posted.