PHP Classes
elePHPant
Icontem

classListbox: Generate form select inputs from database queries

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-10-16 (9 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,194 All time: 2,992 This week: 1,514Up
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
Name: Carlos Miguel Guevara <contact>
Classes: 3 packages by
Country: Mexico Mexico
Age: 33
All time rank: 3454 in Mexico Mexico
Week rank: 891 Down13 in Mexico Mexico Down

Details provided by the author  
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  
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

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,194All time:2,992
 This week:0This week:1,514Up
 User Comments (1)  
 
Excellent
5 years ago (kishore kumar)
80%StarStarStarStarStar