I am only wanting data shown when more than two characters are entered in the search bar. Also when the page loads up all I want is the search bar with the table headings below ie. no data must be pulled through.
Hi rcadmin,
You can do this with PHP in the WHERE box for the listing. Check the length of the search value and if it isn't long enough set an 'invalid' WHERE clause like '1 = 2' so that no records are returned.
Bob
You can do this with PHP in the WHERE box for the listing. Check the length of the search value and if it isn't long enough set an 'invalid' WHERE clause like '1 = 2' so that no records are returned.
Bob
Hi Bob,
The only where box that I can can see is under the General tab and when I put anything there, nothing ever shows up which means my code must be wrong.
Looking at your tutorials I am guessing that I need to put something like
in the where box but instead of 'title' I need the search variable for the searchbox (which I don't know what it is).
Also on a different note, because I have set the default listing to "5", the user can't seem to change it.
http://www.rosmini.school.nz/index.php/component/chronoconnectivity/StaffList
The only where box that I can can see is under the General tab and when I put anything there, nothing ever shows up which means my code must be wrong.
Looking at your tutorials I am guessing that I need to put something like
<?php
// over here I will test for the length of the string and set $wherestring="where '1=2'" if too short
$wherestring = " WHERE `title` LIKE '%$title%' ";
$title = JRequest::getString('title', '', 'post');
if ( $title ) {
echo $wherestring;
}
?>
in the where box but instead of 'title' I need the search variable for the searchbox (which I don't know what it is).
Also on a different note, because I have set the default listing to "5", the user can't seem to change it.
http://www.rosmini.school.nz/index.php/component/chronoconnectivity/StaffList
Hi rcadmin,
I'm not sure which version you have, but mine has a little note under the WHERE box that says, in part:
Bob
I'm not sure which version you have, but mine has a little note under the WHERE box that says, in part:
2 - don't use the WHERE word.
Bob
Hi Bob,
I am using 4.0 RC3.1 on Joomla 2.5.8
Yes I know but I can't work out how to structure it. I am needing to say something which means the following:
Part 1: This I can do
If length of search string<3 then search string = "###"
Part 2: This I am not sure about
'teacher field' or 'subject field' or 'management field' contains one of the keywords in the search string.
Or is my logic just totally wrong.
I am using 4.0 RC3.1 on Joomla 2.5.8
Yes I know but I can't work out how to structure it. I am needing to say something which means the following:
Part 1: This I can do
If length of search string<3 then search string = "###"
Part 2: This I am not sure about
'teacher field' or 'subject field' or 'management field' contains one of the keywords in the search string.
Or is my logic just totally wrong.
This topic is locked and no more replies can be posted.