RE: Warning: Missing argument 7 calling a function

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

 



On 09 January 2006 16:14, enediel gonzalez wrote:

> thanks everybody who answered me,
> the segment bellow is the code that gave me problems, the $app_name
> was the 7th parameter neccesary for me to call the
> GetCommandDeclaration function,
> the solution I had for a while was to declare the variable global. :(

Um -- the code you have posted contains a declaration for function
GetCommandDeclaration(), but no call of it -- only one to
GetProcedureDeclaration().

And in answer to you original question, you could always make the 7th
parameter optional:

    function GetCommandDeclaration($RPM, $var2, $RFactor,
                                   $minimum, $maximum, $sport,
                                   $app_name='default') {

> 
> $app_name = "";
> 
> function GetCommandDeclaration($RPM, $var2, $RFactor, $minimum,
> $maximum, $sport){
>    global $app_name;
>   //code here
> }
> 
> function Process(){
>   global $db, $app_name;
>   $query = get_query_declaration();
> 
>   $result = mysql_query($query, $db);
>   $rowCount = mysql_num_rows($result);
>   $myCounter = 0;
> 
>   while ($myCounter < $rowCount){
>     mysql_data_seek($result, $myCounter);
>     $row = mysql_fetch_assoc($result);
> 
>     $RPM = $row['RPM'];
>     $var2 = $row['var2'];
>     $RFactor = $row['RFactor'];
>     $minimum = $row['minimum'];
>     $maximum = $row['maximum'];
>     $sport = $row['$sport'];
> 
>     $app_name = $row['app_name'];
> 
>     $str_command_declaration = GetProcedureDeclaration($RPM, $var2,
> $RFactor, 
> 
> $minimum, $maximum,
> $sport);
>     //code here
>   }
> }
> Linux user 300141
> Debian GNU/Linux

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

-- 
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