Thanks to Max and Greyhead for all the help on the code. I'm just relaying their notes 😀 !
This is based on the example database set up from this How-To tutorial:
Forms and Connectivity Example start to finish!
In your Joomla backend, go to:
Components -> Chrono Connectivity -> Connections Management
Choose your form.
Under the General tab put this code in these text boxes:
Where SQL:
<?php
$search_array = array('firstname', 'lastname', 'scrnum');
$where = array();
foreach ( $search_array as $search ) {
$value = JRequest::getVar($search, '' , 'post');
if ( $value ) {
$where[] = " $search LIKE '$value%' ";
}
}
if ( !empty($where) ) {
echo " WHERE ".implode(' AND ', $where);
}?>
The following Header code goes above what you already have there.
Header:
<div style="float:right">
Search for a <b>last name</b>: <input type="text" name="lastname">
<b>first name</b>: <input type="text" name="firstname">
<b>number</b>: <input type="text" name="scrnum">
<input type="submit" value="Search" name="undefined" style='width:80px; color:#cccccc; background-color:#222222; cursor:pointer;' /></div>
Some notes:
* This code is VERY touchy to spaces, quotes, and set up. Make sure you are using it just as it is used here.
* You need to substitute the dabase column names with your column names. The names used here are firstname, lastname, scrnum. Change these to yours in all instances above.
* In the Header code, I have the div style attribute of "float:right" because I wanted it to the right on my page, buy you can leave this out or put left in there to have it left aligned.
* The Header code above worked best for me at the top of my other header code.
* This line of code:
<input type="submit" value="Search" name="undefined" style='width:80px; color:#cccccc; background-color:#222222; cursor:pointer;'
defines how the search button looks. change the value="Search" to whatever word you want to show up there and then you can change the hex colors to fit your template. Also change the width to suit your needs. The cursor:pointer makes sure that your cursor changes to a hand symbolizing a link on the page instead of just remaining as an arrow in some browsers.