Re: How do I import tables into MySQL from web page ...
| From: | Analysis & Solutions | Date: | Wed, 10 Jul 2002 06:12:13 +0000 |
| Subject: | Re: How do I import tables into MySQL from web page ... | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106676@lists.php.net to get a copy of this message | ||
On Tue, Jul 09, 2002 at 10:59:04PM -0700, Fargo Lee wrote:
>
> Thanks but it still returns "Success" on a failure. If anyone knows if it is
> even possible to assign the output of system, passthru or exec to a variable
> to check for success or failure and how to do it, please advise. The $status
> variable seems to always be empty on success or failure when I try to echo
> it.
The way you set things up, $status is the last line of text returned by
executing the command. Add the return_var argument to your system()
statement. Take a look at the manual again.
http://www.php.net/manual/en/function.system.php
You can only make an accurate if() statement if you know what the values
are you're expecting.
Now, do some hacking. Set up the test to fail. Echo $status and $return
to the screen and see what they look like. Set up the test to succeed.
What do $status and $return look like then?
--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