Good
I have the following problem I am inserting multiple data through checkbox that part is already working now I wanted to do the validation to check the box of those that are already inserted in the database but I am not able to get all marked.
Code
<?php
$result_cat=mysql_query("select * from colecoes where activo=1");
while($row_cat=mysql_fetch_object($result_cat)){
?>
<div style="float: left; margin: 5px 5px 5px 0px;"><input type="checkbox" <?php // if($_REQUEST['categoria'] == $row_cat->categoria_slug) echo "checked='checked'"; ?> name="categoria[]" value="<?php echo $row_cat->slug; ?>" /> <?php echo $row_cat->titulo; ?></div>
<?php
}
?>
Product categories table
CREATE TABLE IF NOT EXISTS 'categorias_estabelecimentos' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'estabelecimento_id' int(11) NOT NULL,
'categoria_slug' varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY ('id')
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;