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($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)) {
> >     $authors[] = array('AUS' => $data['AUS'], 'id' => $data[id]);
> > }
> >
> > ..
> >
> > foreach ($author in $authors) {
> >     $sql += "INSERT INTO newtable VALUES ($author['AUS'],
> > $author['id']);\r\n";
> > }
> >
> > --
> > Seigo
> > www.geocities.com/seigo_ua/
>
>
> Just a note to help the learning process. Either mysql_fetch_assoc() and
> mysql_fetch_array() will return your result in an array, so you don't
> need to actually create one.
>
> --
> Chris Martin
> Web Developer
> Open Source & Web Standards Advocate
> http://www.chriscodes.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to