Ok I make a query in mysql:
"SELECT * FROM ibf_moderators WHERE forum_id='".$class->forum['id']."'"
and then I want to load the each of the id column values from ibf_moderators in my $cc_array.
$cc_array = array();
while( $r = mysql_fetch_array($result2))
{
ADD VALUE into the array here
}
How do I loop through my results adding the id column into my $cc_array?
MYSQL into Array
Moderator: General Moderators
Code: Select all
$x=0;
while( $r = mysql_fetch_array($result2)) {
$cc_array[$x] = $r['ID_column_name'];
$x++;
}
Last edited by McGruff on Thu Aug 11, 2005 2:06 pm, edited 1 time in total.
Code: Select all
$cc_array = array(); // to avoid warnings
while( $r = mysql_fetch_array($result2))
$cc_array[] = $r['ID_column_name'];Code: Select all
$cc_array = array(); // to avoid warnings
while( $r = mysql_fetch_array($result2))
$cc_array[] = $r;