Re: calling function from function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Nov 2004 12:26:17 -0700, Jason <jason.gerfen@xxxxxxxxxxxx> wrote:
> function db( $host, $user, $pass, $dbnam ) {
>   $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
>         @mysql_select_db( $dbnam )or die( mysql_error( $db ) );
>   return $db;
> }
> 
> function logs() {

If you plan to pass parameters to this function you should probbaly define them:

function logs( $var1 ) {

There are built-in PHP functions that assist with handling variable
function parameters such as func_get_arg(), func_get_args(), and
func_num_args() if you don't want to pre-define any however.

>   global $defined;
> 
>   db( $defined[9], $defined[1], $defined[2], $defined[3] );
>   ... do some processing ...

What does print_r( $defined ) show you?  Is that what you expect to be
in the array?


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux