Re: Advice for dataupload
| From: | php3 at developersdesk dot com | Date: | Sat, 13 Apr 2002 02:21:28 +0000 |
| Subject: | Re: Advice for dataupload | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18471@lists.php.net to get a copy of this message | ||
Addressed to: "Michael Andersson" <chrazy@hotpop.com>
php-db@lists.php.net
** Reply to note from "Michael Andersson" <chrazy@hotpop.com> Fri, 12 Apr 2002
11:58:31 +0200
>
>
> "Jason Wong" <phplist@gremlins.com.hk> skrev i meddelandet
> news:php.db-18414@news.php.net...
> > On Monday 08 April 2002 19:15, Michael Andersson wrote:
> >
> > > What happens to a blob field with lets say a image when dumping a mysql
> > > table to a file?
> >
> > I don't use BLOB fields. You try it and let me know ;-)
>
> Well now i tried, and it doesnt work at all, just so you know :)
>
> So now i have to fugure out a way to dump the table with blob:s in it to a
> file cause my isp dont allow me to dump to another mysql dbase over the net
> or any other way exept for a file...
The FROM ISP doesn't allow it. What about the TO ISP? If you can get them
to allow access from the old server:
$Con1 = mysql_connect( 'oldhost', 'olduser', 'oldpassword' );
mysql_select_db( 'olddbname', $Con1 );
$Con2 = mysql_connect( 'newhost', 'newuser', 'newpassword' );
mysql_select_db( 'newdbname', $Con2 );
$R1 = mysql_query( "SELECT * FROM tablename", $Con1 );
while( $Data = mysql_fetch_array( $R1 );
mysql_query( "INSERT INTO tablename ~data~", $Con2 );
}
Of course you will need to translate '~data~' into a valid SET or VALUES()
block for each table, but this may allow you to get your data out of the
old ISP's server without their help.
Rick
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com