Function questions...

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

 



	I am trying to convert something that I have working in a PHP script
to be a function in a library type of file.  The code contained in the
function works fine in another script, but I am currently getting no output
from the function.  I have a question about the nature of functions that may
help clear up my problems.

	Do 'echo' commands within functions actually work to directly
display information?  I have only used functions up to this point that use
the 'return' command to pass a variable back to the script that called the
function.  I am pretty confused on how to actually use a function that
formats data to be displayed.  This is my primary source of confusion.

	Below is the function that is giving me trouble:

function CheckboxList($query) {
  $result1 = mysql_query($query);
  do {
    $sys = split('-', $list['id-sys']);
    if ($cnt == 1) { 
      $cnt = 2; 
      echo "<tr><td width=\"161\"><input name=\"system[]\" type=\"checkbox\"
value=\"$sys\">";
      echo $sys."</td>";
    } elseif ($cnt == 2) { 
	  $cnt = 3;
      echo "<tr><td width=\"161\"><input name=\"system[]\" type=\"checkbox\"
value=\"$sys\">";
      echo $sys."</td>";
    } elseif ($cnt == 3) { 
	  $cnt = 4;
      echo "<tr><td width=\"161\"><input name=\"system[]\" type=\"checkbox\"
value=\"$sys\">";
      echo $sys."</td>";
	} elseif ($cnt == 4) { 
	  $cnt = 1;
      echo "<tr><td width=\"161\"><input name=\"system[]\" type=\"checkbox\"
value=\"$sys\">";
      echo $sys."</td></tr>";
	}
  } while ($list = mysql_fetch_assoc($result1));
}

	Here is also the way I am calling this function:
<snip...>
$query = "SELECT * FROM accounts WHERE verifyurl='$safe_verify_string'";
<snip...>
CheckboxList($query);
<snip...>

	Is there something wrong with the way in which I am calling this
function?  Thanks in advance for all the help.


Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@sbc.com
Web:  http:\\ldsa.sbcld.sbc.com



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux