Re: How do I import tables into MySQL from web page ...
| From: | Richard Lynch | Date: | Thu, 11 Jul 2002 08:28:59 +0000 |
| Subject: | Re: How do I import tables into MySQL from web page ... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-107068@lists.php.net to get a copy of this message | ||
>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 <
<?php
exec("mysql -u myuserid --password=mypassword myddbname ...", $result,
$errorcode);
echo implode('', $result);
if ($errorcode){
echo "OS Error $errorcode Use 'man errno' to find meaning, but it's
almost always path/permissions";
}
?>
Oh yeah. You'll need the full path to mysql, almost for sure.
--
Like Music? http://l-i-e.com/artists.htm
Off-Topic: What is the moral equivalent of 'cat' in Windows?