Advertisement
| 03.23.2008 at 03:02PM PDT, ID: 23263057 |
|
[x]
Attachment Details
|
||
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: |
if ('option A' == $_REQUEST['select']) {
$table = 'tbArtist';
$field = 'ArtistFamilyf';
} else if ('option B' == $_REQUEST['select']) {
$table = 'tbAlbum';
$field = 'AlbumName';
} else if ('option C' == $_REQUEST['select']) {
$table = 'tbtracks';
$field = 'TrackName';
}
$words = split(" ", $_REQUEST['Textfield1']);
$Query = "SELECT * FROM ".$table." WHERE 1=2 ";
foreach($words as $word)
{
if ($word)
{
$Query .= " OR $field LIKE '%$word%' ";
}
}
$result = mysql_query($Query);
while ( $rw = mysql_fetch_assoc( $result ) ) {
echo "{$rw["$field"]}<br />\n";
}
?>
|
Advertisement