RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Insert multiple checkbox values of array into mysql db

Join Date: May 2008
Posts: 13
Reputation: phpuser is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
phpuser phpuser is offline Offline
Newbie Poster

Re: Insert multiple checkbox values of array into mysql db

  #2  
Jul 1st, 2008
I think for multiple check boxes insert, you have to coding like this in your php file

$c=$_REQUEST['chkbx'];

for($i=0;$i<count($c);$i++)
{
$val=$c[$i];
$sql="INSERT INTO eventdesc(show) VALUES($val);
$res=mysql_query($sql);
}

By this coding,you can insert all check boxes values in your DB which are checked.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:37 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC