Im trying to take two columns from a table and put the values into an array, so i can use the arrays to put the values into list boxes. This is what i have so far any help will be appreciated.
<code>
$ids = Array(); //array declaration
//query selecting data from table
$query = 'Select category_id FROM categories';
$result = mysql_query($query) or die(mysql_error());
//while loop continues until no more values in table
while ($row = mysql_fetch_assoc($result)) {
foreach ($line as $col_value) {
$ids($col_value);
//sets array values to each column value
}
}
echo " $ids";
</code>
Live by the code, Die by the code!!
<code>
$ids = Array(); //array declaration
//query selecting data from table
$query = 'Select category_id FROM categories';
$result = mysql_query($query) or die(mysql_error());
//while loop continues until no more values in table
while ($row = mysql_fetch_assoc($result)) {
foreach ($line as $col_value) {
$ids($col_value);
//sets array values to each column value
}
}
echo " $ids";
</code>
Live by the code, Die by the code!!