Recommend this page to a friend! |
Download .zip |
Info | View files (7) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2006-03-25 (10 years ago) | Not enough user ratings | Total: 1,485 This week: 1 | All time: 2,548 This week: 1,047 |
Version | License | PHP version | Categories | |||
editableselect 1.0 | GNU General Publi... | 3 | HTML |
Description | Author | |||||||||||||
This class can be used to generate a form select input with a text input that can alter the selected value. |
|
If you want to use the values stored into a table of a mysql db, it is very simple. Add, for example, a wrapper (in this example the ez_sql.class You find it in the site phpclasses.org) include ("include/ez_sql.php"); After, you query your db as if ( $mails = $db->get_results("SELECT mail FROM mail") ) { // Loop through the resulting array on the index $users[n] foreach ( $mails as $mail ) { // Access data using column names as associative array keys $str.=$mail->mail.";"; } } $select->print_select("mail",$str); ?> The select is at this point with the values of db At the post of form you insert the value in the db if it is not present if(isset($_POST['mail'])) { //verifica se la mail inserita era già nel db o no if (!( $n = $db->get_var("SELECT count(*) FROM mail WHERE mail = '$_POST[mail]'") )) { // Insert into the database $db->query("INSERT INTO mail (mail) VALUES ('$_POST[mail]')"); } .... other instructions } |
Files |
File | Role | Description | ||
---|---|---|---|---|
images (3 files) | ||||
editselect.php | Class | Tha class | ||
index.php | Example | Example | ||
readme_db.txt | Doc. | tip for use with a db | ||
vai.php | Example | Test page |
Files | / | images |
File | Role | Description |
---|---|---|
select_arrow.gif | Data | images |
select_arrow_down.gif | Data | image |
select_arrow_over.gif | Data | image |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.