hi i have a php dropdownlistbox (select button of html) which having three values on is all and second is activated and third one is deactivated. i want when use select all then show all values of database and when user click on activated then show only activated values and if user select deactivated then only show deactivated values while i manage in database a status field which values are 0 & 1. 0 for deactivated and 1 for activated.
how can i use php dropdownlistbox event with php to do this type of work.
thanks
regards
umesh daiya
umeshMCA
0
Newbie Poster
Recommended Answers
Jump to Postput dropdownlistbox in form tag, and post it on change event. get dropdownlistbox value in php code and apply the search from database related to your value (value get from dropdownlistbox).
this is most simple way to handle search with dropdownlistbox.
Jump to PostJavascript
function limiterOnChange() { document.limiterForm.submit(); }
PHP
// near the top $val='2'; if ($_POST['limiter']) { $val=$_POST['limiter']; if ($val==2) { $db_data=mysql_query("select * from yourtable"); } else { $db_data=mysql_query("select * from yourtable where activated='$val'"); } // right above the area that displays the database info (is …
All 5 Replies
KamranArshad
0
Light Poster
dietdew12z
8
Junior Poster
Wraithmanilian
1
Junior Poster
KamranArshad
0
Light Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.