RE: [PHP] How do I import tables into MySQL from web page ...
| From: | John Holmes | Date: | Wed, 10 Jul 2002 11:48:08 +0000 |
| Subject: | RE: [PHP] How do I import tables into MySQL from web page ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106758@lists.php.net to get a copy of this message | ||
Try using backticks, and you don't need spaces after -u and -p
$result =
MySQL -uuser -ppassword databasename < filename.sql
Note that if it succeeds, nothing will be returned. Same as when you run
the command on the command line.
---John Holmes...
> -----Original Message-----
> From: Fargo Lee [mailto:fargolee@iname.com]
> Sent: Wednesday, July 10, 2002 1:27 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] How do I import tables into MySQL from web page ...
>
> Thanks for pointing out the syntax error. I added the space after the
-u
> but
> it did not make any difference. It still gives the same result, that
is
> "Success", when it actually fails. What I am trying to figure out is
how I
> can tell if it failed (did not create the tables)? The $status
variable
> does
> not appear to hold the output of the system() function. Anyone know
how to
> get the output of system, passthru or exec into the $status variable
to
> check for success or failure?
>
> "Analysis & Solutions" <danielc@analysisandsolutions.com> wrote in
message
> news:20020710030254.GA10805@panix.com...
> > On Tue, Jul 09, 2002 at 06:09:36PM -0700, Fargo Lee wrote:
> > >
> > > $status = system("mysql -umyuserid -pmypassword mydbname <
> >
> > You need a space between "-u" and "myuserid"
> >
> > --Dan
> >
> > --
> > PHP classes that make web design easier
> > SQL Solution | Layout Solution | Form Solution
> > sqlsolution.info | layoutsolution.info | formsolution.info
> > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php