You are here: Re: multiple checkboxes « All PHP « IT news, forums, messages
Re: multiple checkboxes

Posted by ulyx on 12/06/06 17:59

I hope i have write this correct. I get no error, but i can see any new
updated data in db. There is no updating ?
I have created tested table and field.

?>
<form action="testCheckBox.php" name="test" method="post">
<?
$weekdays = array( "mon" => "Monday",
"tue" => "Tuesday",
"wed" => "Wednesday",
"thr" => "Thursday",
"fri" => "Friday",
"sat" => "Saturday",
"sun" => "Sunday" );

// initialize $days as being empty:
$days = array();

echo "<b>Days of Service:</b><br />";
foreach( $weekdays as $value => $desc ) { //walk through possible values
echo ' <INPUT type="checkbox" name=days[]" value="'.$value.'"';
echo ( in_array( $value,$days ) ) ? " CHECKED" : ""; //if days are
already selected, check the box
echo '>'.$desc.'<br />'; //echo the descriptive name of the item
}

$daylist = implode(",",$days);
//$result = mysql_query("UPDATE dbTest SET db_days = '$daylist' WHILE
record_id = $record_id");
$days = explode(",", $dbTest ['db_days']);
?>
<input type="submit" name="Submit" value="Submit">
</form>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация