[PHP] Re: create and read array

2004-09-12 Thread Alexander Kleshchevnikov
Yeah, thanks. Good idea! It is good to code that: $authors = array(); while ($authors[] = mysql_fetch_assoc($news)); "Chris Martin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Alexander Kleshchevnikov wrote: > > Maybe you want this: > > > > while ($data = mysql_fetch_assoc($ne

[PHP] Re: create and read array

2004-09-11 Thread Chris Martin
Alexander Kleshchevnikov wrote: Maybe you want this: while ($data = mysql_fetch_assoc($news)) { $sql += "INSERT INTO newtable VALUES ($data['AUS'], $data['id']);\r\n"; } If you nevertheless want save the data in array you can use a two-dimensional array $authors: $authors = array(); while ($dat

[PHP] Re: create and read array

2004-09-11 Thread M. Sokolewicz
Alexander Kleshchevnikov wrote: Maybe you want this: while ($data = mysql_fetch_assoc($news)) { $sql += "INSERT INTO newtable VALUES ($data['AUS'], $data['id']);\r\n"; } I seriously recommend using .= on strings instead of +=. += DOES work, that's true, but it's not INTENDED to be used on stri

[PHP] Re: create and read array

2004-09-11 Thread Alexander Kleshchevnikov
Maybe you want this: while ($data = mysql_fetch_assoc($news)) { $sql += "INSERT INTO newtable VALUES ($data['AUS'], $data['id']);\r\n"; } If you nevertheless want save the data in array you can use a two-dimensional array $authors: $authors = array(); while ($data = mysql_fetch_assoc($news))