Thank you for all your help, but, I am sill having trouble.
I not sure where to place ($where[] = '`published` > 0';).
Here is my code:
WHERE box:<?php
$title = JRequest::getString('title', '', 'post');
if ( $title ) {
echo " WHERE `state` LIKE '%$title%' OR `city` LIKE '%$title%' ";
}
?>
Header box:<?php
// get the number of records returned
$db =& JFactory::getDBO();
global $count;
$count = $db->loadResult();
$script .= "
$('clear').addEvent('click', function() {
$('title').value = '';
});
";
$doc =& JFactory::getDocument();
if ( $script ) {
$script = "window.addEvent('domready', function() { $script });";
$doc->addScriptDeclaration($script);
}
if ( $style) {
$doc->addStyleDeclaration($style);
}
// get the previous filter string
$title = JRequest::getString('title', '', 'post');
?>
<!-- start the listing table -->
<table>
<thead>
<tr>
<th><h2>Support Group Listings</h2></th>
</tr>
<tr>
<th><strong>Listings are sorted alphabetically ascending by state/province and then by city.</strong></th>
</tr>
<tr><td>
<br />
<!-- display the filter box and buttons -->
<input type='text' name='title' id='title' value='<?php echo $title; ?>' /> <input type='submit' name='filter' id='filter' value='Filter by State/Province or City' /> <input type='button' name='clear' id='clear' value='Clear' />
<?php
// check if there are any records returned
if ( !$count ) {
// no records - show the message
echo "<div>Sorry, no results were found.</div>";
} else {
// some records, show the header & footer rows
?>
</td></tr>
<tr><td><div align="right"><strong><u>{new_record}</u></strong></div></td></tr>
</thead>
<?php
}
?>
<tbody>
Body box:<tr><td><h2>{state}</h2></td></tr>
<tr><td><strong>City: </strong><br />{city}</td></tr>
<tr><td><strong>Country: </strong><br />{country}</td></tr>
<tr><td><strong>Support Group Name: </strong><br />{sg_name}</td></tr>
<tr><td><strong>Location: </strong><br />{location}</td></tr>
<tr><td><strong>Time & Dates: </strong><br />{time_date}</td></tr>
<tr><td><strong>Description: </strong><br />{description}</td></tr>
<tr><td><strong>Contact: </strong><br />{contact}</td></tr>
<tr><td><div align="right"><strong><u>{edit_record}</u> <u>{delete_record}</u></strong></div></td></tr>
<tr><td><p style="background-color: #014881; width: 400px; height: 2px;"></p></td></tr>
Footer box:</tbody>
</table>
<?php
// get the row count and show the pagination if needed
global $count;
if ( $count ) {
?>
{pagination}
<?php
}
?>
Again thank you for all your help.
I am determined to get this working.