01.
<html>
02.
<head>
03.
<title></title>
04.
</head>
05.
<body>
06.
<form name=
"frmSearch"
method=
"get"
action=
"<?php echo $_SERVER['SCRIPT_NAME'];?>"
>
07.
<table width=
"599"
border=
"1"
>
08.
<tr>
09.
<th>Keyword
10.
<select name=
"select2"
id=
"select2"
>
11.
<?php
12.
13.
include
"connect.php"
;
14.
$strSQL
=
"SELECT DISTINCT name_or FROM organization "
;
15.
$objQuery
= mysql_query(
$strSQL
);
16.
17.
?>
18.
<?
while
(
$objResuut
= mysql_fetch_array(
$objQuery
))
19.
{ ?>
20.
<option value=
"<?php echo $objResuut["
id_organiz
"];?>"
><?php
echo
$objResuut
[
"name_or"
];?></option>
21.
<?php
22.
}
23.
?>
24.
</select>
25.
<input type=
"submit"
value=
"Search"
></th>
26.
</tr>
27.
</table>
28.
</form>
29.
<?php
30.
if
(
$_GET
[
"select2"
] !=
""
)
31.
{
32.
include
"connect.php"
;
33.
$strSQL
=
"SELECT * FROM record WHERE (id_organiz LIKE '%"
.
$_GET
[
"select2"
].
"%') "
;
34.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
35.
?>
36.
<table width=
"677"
border=
"1"
>
37.
<tr>
38.
<th width=
"91"
> <div align=
"center"
>CustomerID </div></th>
39.
<th width=
"98"
> <div align=
"center"
>Name </div></th>
40.
<th width=
"198"
> <div align=
"center"
>Email </div></th>
41.
<th width=
"97"
> <div align=
"center"
>CountryCode </div></th>
42.
<th width=
"59"
> <div align=
"center"
>Budget </div></th>
43.
<th width=
"71"
> <div align=
"center"
>Used </div></th>
44.
</tr>
45.
<?php
46.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
47.
{
48.
?>
49.
<tr>
50.
<td><div align=
"center"
><?php
echo
$objResult
[
"CustomerID"
];?></div></td>
51.
<td><?php
echo
$objResult
[
"name"
];?></td>
52.
<td><?php
echo
$objResult
[
"address"
];?></td>
53.
<td><div align=
"center"
><?php
echo
$objResult
[
"tel"
];?></div></td>
54.
<td align=
"right"
><?php
echo
$objResult
[
"job"
];?></td>
55.
56.
<td align=
"right"
><?php
echo
$objResult
[
"id_organiz"
];?></td>
57.
58.
</tr>
59.
<?php
60.
}
61.
?>
62.
</table>
63.
<?php
64.
mysql_close();
65.
}
66.
?>
67.
</body>
68.
</html>