Posted by Andy Jeffries on 05/09/06 11:22
On Tue, 09 May 2006 00:35:55 -0700, apostolosl wrote:
> $command="mysql --host=$host --user=$user --password=$pass
> --database=$db;";
> system($command);
>
> , where $host, $user etc are being set at the top of the page. This works
> fine and I get connected to the remote database.
>
> Now I need to run the following mysql command: source stb_products.sql
That's where you're going wrong. What you want to do is:
$command="mysql --host=$host --user=$user --password=$pass
--database=$db < stb_products.sql";
system($command);
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
[Back to original message]
|