Php > Databases
PHP and MySQL scripting for Muyltiple CheckBoxes
PHP and MySQL scripting for Muyltiple CheckBoxes // This code is useful for multiple checkboxes. I'm using array facility with in this code.
Code:
Red
Blue
Green
Megenta
// In MySQL, pls make one table i.e. // colors: (colorcode varchar(20), colorname varchar(20)); //declare information for database connectivity mysql_connect(localhost,username,pwd); mysql_connect_db(databasename); $ecode = $_POST['code']; $ec = $_POST['colors']; //this function store ur values on the table. function print_selected_values($e_code,$area_array) { foreach($area_array as $color_value){ $query = "insert into colors(colors,code)values('$color_value','$e_code')"; $result = mysql_query($query) or die ("query not made"); } print("entry successfully made....!"); } print_selected_values($ecode,$ec); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage