okay...this is what I tried:
/------------------------------------------
List found matches.
------------------------------------------/
function list_matches ($table) {
if ($array = clean_array ($GLOBALS['HTTP_POST_VARS'])) {
if (count ($array) >= 1) {
$i=0;
while (list ($field, $value) = each ($array)) {
if (is_array ($value)) $value = implode ("%", $value);
if ($i<1) {
$sql = "SELECT * FROM 42directory WHERE ${field} LIKE '%${value}%'";
} else {
$sql .= " AND ${field} LIKE '%${value}%'";
}
$i++;
}
}
}
// echo $sql;
// if($GLOBALS['CONFIG']['DEBUG']) echo("<!-- \$sql = '$sql' -->\n");
$result = db_query($sql);
$rows = db_numrows($result);
$sql .= "ORDER BY Last_Name";
?>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Found: <?php echo $rows ?>
<hr>
</td>
</tr>
<tr>
<td><?php
while ($row = db_fetch_array($result)) {
print "<a href=\"results.php?rid=". $row['ID'] ."\">". $row['Last_Name'] .", ". $row['First_Name'] ."</a><i> ". $row['Business_Name'] ."</i>\n";
print "<br />\n";
print $row['City'] .", ". $row['State'] .", ". $row['Zip']."\n";
print "<hr />\n";
}
?>
</td>
</tr>
</table>
<?php
}
/------------------------------------------
Browser.
------------------------------------------/
function browser ($table) {
$letter = $GLOBALS['HTTP_POST_VARS']['letters'];
$sql = "SELECT * FROM 42directory WHERE last_name LIKE '${letter}%'";
// echo $sql;
// if($GLOBALS['CONFIG']['DEBUG']) echo("<!-- \$sql = '$sql' -->\n");
$result = db_query($sql);
$rows = db_numrows($result);
$sql .= "ORDER BY Last_Name";
?>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Found: <?php echo $rows ?>
<hr>
</td>
</tr>
<tr>
<td><?php
while ($row = db_fetch_array($result)) {
print "<a href=\"results.php?rid=". $row['ID'] ."\">". $row['Last_Name'] .", ". $row['First_Name'] ."</a><i> ". $row['Business_Name'] ."</i>\n";
print "<br />\n";
print $row['City'] .", ". $row['State'] .", ". $row['Zip']."\n";
print "<hr />\n";
}
?>
</td>
</tr>
</table>
<?php
}
?>
but it didn't change anything. :-(
Thanks for helping on this.