PHP Classes

classListbox: Generate form select inputs from database queries

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 1,212 All time: 3,136 This week: 57Up
Version License Categories
classlistbox 1.0GNU General Publi...HTML, Databases
Description 

Author

This class can be used to create form select inputs from MySQL database query results, similar to ASP.NET listbox control.

The class can execute a given MySQL dquery that extracts the option names and the respective values. Then it generates a form select input with the given values. A given value can be displayed as the initially selected value.

Optionally, the class may also generate the necessary Javascript code to make the form of the input be automatically submitted when the user changes the input value.

Picture of Carlos Miguel Guevara
  Performance   Level  
Name: Carlos Miguel Guevara <contact>
Classes: 3 packages by
Country: Mexico Mexico

Details

Notes: -easy usage -Just create a new object classListbox -Dont forget to set the name when creating the object. this name is the name of the <select> -In the set_query method you should send the query and the primary key or the id you use to identify each register -dont forget to add this primary key to the select query ex: if your key is "productID" and you want to get the "productname", your query should look like this: $object->setquery("selet productname,productID from products","productID") -have fun! -You can make the page refresh th data by doing a submit by using the $object->set_postback("true") or disable it by using $object->set_postback("false") just like in asp.net -Each time you chage the selected value from the listbox a submit event is call to refresh the content of the item if set_postback is set to "true" -to avoid submitting the form you can modify your form by getting a name to your submit button ... any questions: dejitaru@gmail.com

  Files folder image Files (5)  
File Role Description
Plain text file classListbox Class the class file
Accessible without login Plain text file estilo.css Data style sheet
Accessible without login Plain text file example.php Example example
Accessible without login Plain text file mydatabase.sql Data the database for the example
Accessible without login Plain text file readme.txt Doc. Notes of usage

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,212
This week:0
All time:3,136
This week:57Up
User Ratings User Comments (1)
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:66%StarStarStarStar
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:937
 
Excellent
15 years ago (kishore kumar)
80%StarStarStarStarStar