Forum Moderators: coopster
HOWEVER...
it only displays the last entry from my checkbox selections?
here's the code, identical to the one from the post above:
***********************************************
from my form:
<input type="checkbox" value="dog" name="test[]"> Dog<br>
<input type="checkbox" value="cat" name="test[]"> Cat<br>
<input type="checkbox" value="horse" name="test[]"> Horse<br>
From my php:
if(isset($_POST["test"])) {$test = $_POST["test"];} else {$test=array();}
for ($i="0"; $i<count($test); $i++) {
if(!is_numeric($test[$i])) {$test[$i]="";}
if(empty($test[$i])) {unset($test[$i]);}}
$test = implode ("<>", $test);
$test = "<>".$test."";
mysql_query("INSERT INTO `my_table` VALUES ('$test')")
***********************************************
so if I select all the options in my form, in my database I get the only value in my column is "<>horse", where I want it to be: "<>dog<>cat<>horse"
ANYONE?