Re: How do I import tables into MySQL from web page ...
| From: | Fargo Lee | Date: | Wed, 10 Jul 2002 19:19:12 +0000 |
| Subject: | Re: How do I import tables into MySQL from web page ... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106930@lists.php.net to get a copy of this message | ||
Thanks that explains why I did not initially have a space after the -u as I
copied the code from another of my applications that used backticks without
reviewing it. It appears that using backticks is also the only way to assign
the output of a command to a variable as system(), passthru() and exec()
don't appear to be able to do this. Unfortunately this snippet of code needs
to be compatible with PHP installations running in safe mode so I can't use
backticks.
"John Holmes" <holmes072000@charter.net> wrote in message
news:021501c22807$a91e42d0$b402a8c0@mango...
> 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
>