mdvignesh Posted April 28, 2011 Share Posted April 28, 2011 I have some text boxes for searching the students in database also i have a drop down box for selecting student with balance amount to be paid tell me how to filter or search the list of stuents <select> <option value="">All </option> <option value="">Unpaid </option> <option value="">Paid </option> </select> Link to comment https://forums.phpfreaks.com/topic/235001-filter-search/ Share on other sites More sharing options...
JKG Posted April 28, 2011 Share Posted April 28, 2011 can you give us some idea of your table structure? 'tell me how to' isn't very polite... Link to comment https://forums.phpfreaks.com/topic/235001-filter-search/#findComment-1207742 Share on other sites More sharing options...
fugix Posted April 28, 2011 Share Posted April 28, 2011 $sql = "select * from table_name where column_name=paid"; $result = mysql_query($sql); Link to comment https://forums.phpfreaks.com/topic/235001-filter-search/#findComment-1207743 Share on other sites More sharing options...
fugix Posted April 28, 2011 Share Posted April 28, 2011 this will filter what students you want information for Link to comment https://forums.phpfreaks.com/topic/235001-filter-search/#findComment-1207744 Share on other sites More sharing options...
JKG Posted April 28, 2011 Share Posted April 28, 2011 ..and implemented.. <select name="status"> <option value="">All </option> <option value="">Unpaid </option> <option value="">Paid </option> </select> <?php $sql = "select appropriate_columns from table_name where column_name='".$_POST['status']."'"; $result = mysql_query($sql); ?> Link to comment https://forums.phpfreaks.com/topic/235001-filter-search/#findComment-1207758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.