search data by filtering

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
merican
Forum Newbie
Posts: 22
Joined: Tue May 18, 2004 8:56 pm

search data by filtering

Post by merican »

hai all again,
I need help to search data in a MYSQL table with different fields. Let say I want to filter by department and by author. I have a search code only search by department. Below is the code:-

Code: Select all

$mysql->Query("SELECT * FROM ffdb_dept WHERE file_dept LIKE '%".$_REQUESTї'department']."%' LIMIT $ffdb->data_bottom,$ffdb->data_top");
Can anyone help me with this. Search data by filtering.
Thank You in advance.

regards,
alfy Merican
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

as in

Code: Select all

ORDER BY desc
or

Code: Select all

ORDER BY asc
??
merican
Forum Newbie
Posts: 22
Joined: Tue May 18, 2004 8:56 pm

hi

Post by merican »

hi all..
at last i figure out something by try an errror..it really works! i modified it to this code:-

Code: Select all

$mysql->Query("SELECT * FROM ffdb_files WHERE file_filename LIKE '%".$_REQUESTї'filename']."%' AND author LIKE '%".$_REQUESTї'author']."%' AND author_site LIKE '%".$_REQUESTї'author_site']."%'   LIMIT $ffdb->data_bottom,$ffdb->data_top");
so now, i can search by filename..author and author_site..TQ alll

Best Regards
Alfy
Post Reply