Hey guys i need to get the database column into a 1 mentionable array.
Here is my code.
$spreadsql = "SELECT `categories_id` FROM `".$TABLES['CATEGORIES_SPREAD']."` WHERE `products_id` = '".$_REQUEST['pid']."'";
$spreadquery = mysql_query($spreadsql, $connection) or die ('Could not execute SQL query:<br />'.$sql.'<br /><strong>'.mysql_error().'</strong>');
$spread = mysql_fetch_assoc($spreadquery);
$array = array();
foreach ($spread as $value) {
$array[$x] = $value;
$x++;
}
<?php do { ?>
<input name="category[]" type="checkbox" value="" <?php print (in_array(readFromDB($categories['categories_id']), $categoriesspread)) ? 'checked="checked"' : '';?> /><?php print readFromDB($categories['category_title']); ?> | <?php print readFromDB($categories['categories_id']); ?><br />
<?php } while ($categories = mysql_fetch_assoc($catquery)); ?>
I wan to then do a check for if the categories id is in the array then check the check box.
Thanks,
Marais