RE: [PHP] Warning: Missing argument 7 calling a function
| From: | Ford, Mike | Date: | Tue, 10 Jan 2006 14:40:28 +0000 |
| Subject: | RE: [PHP] Warning: Missing argument 7 calling a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-228407@lists.php.net to get a copy of this message | ||
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@leedsmet.ac.uk
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