-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.php
39 lines (26 loc) · 907 Bytes
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
# Copyright (c) 2000 Eric Lease Morgan <[email protected]>
# Licensed under the GNU GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
if (! $search_string) {
# display the search form
include "./search.inc";
}
else {
# great, create an sql update query and execute it
$sql = "SELECT *
FROM member_list
WHERE $search_field $search_operator '$search_string'
ORDER BY last_name, first_name";
$rows = mysql_query ($sql);
# uncomment for debuggin' purposes
# echo mysql_errno().": ".mysql_error()."<BR>"; echo"<pre>$sql</pre>";
# display the results
include "results.inc";
# list each member
echo "<ol>";
while ($r = mysql_fetch_array($rows)) {
include "./displayall.inc";
}
echo "</ol>";
}
?>