As couple of people have already mentioned, it is best to dump the
data in to your new table through MySQL itself. Writing a script will
be an overkill unless you are trying to accomplish something through
PHP that cannot be done through MySQL.

Good luck!

On Mar 11, 5:55 pm, Michael Adams <[email protected]> wrote:
> Is there a simple way to do this so my whole weekend isn't spoiled worrying
> about it.
>
> I want to take all the data from a MySQL query and drop it into another table.
>
> I tried:
> ****
>         $foo = array( );
>         while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
>                 $foo -> append($row);
>         }
> ****
>
> But that was a PHP5 solution and even on PHP5 did not seem to like appending
> the first result to an empty array.
>
> This is the best i can do at present which would be extremely wasteful if i
> had 20 columns in the table instead of the three i am showing here:
> ****
>         $foo = array( );
>         $i = 1;
>         while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
>                 $foo[i] = array ('tagID' => $row['id'],
>                         'date' => date("d-m-Y H:i",strtotime 
> ($row['load_date'])),
>                         'keyword' => htmlspecialchars($row['keywords'])) ;
>                 i++;
>         }
> ****
>
> TIA
>
> --
> Michael

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to