SV: User Defined Function Problem

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

 



Hi,

It seems as if you use your parameters for check4Entry in the wrong order
when you call it.
In your call you have check4Entry($username, $round, $region); and in your
definition you have
function check4Entry($name, $reg, $rnd). So you might want to switch $region
and $round in yor call.

regards Henrik Hornemann

> -----Oprindelig meddelelse-----
> Fra: The Cossins Fam [mailto:cossinsfam@hotmail.com]
> Sendt: 17. marts 2003 22:07
> Til: php-db@lists.php.net
> Emne:  User Defined Function Problem
> 
> 
> Does anyone see anything I might be missing as to why this won't work?
> 
> From the file calling the function:
> 
> <?php
> 
> $round = "Round 1";
> $region = "East";
> 
> include "check.php";
> isAuthorized($_COOKIE['username'], $_COOKIE['password']);
> 
> include "checkEntry.php";
> check4Entry($username, $round, $region);
> 
> ...
> 
> From checkEntry.php:
> 
> <?php
> 
> function check4Entry($name, $reg, $rnd) {
> 
>         $connection = mysql_connect("localhost", "root") or 
> die(mysql_error());
> 
>         $db = mysql_select_db("marchmadness", $connection) or 
> die(mysql_error())
> ;
> 
>         $checking = "SELECT * FROM pick WHERE userID = 
> \"$uname\" AND  round 
> = \"$rnd\" AND region = \"$reg\"";
> 
>         $result = mysql_query($checking, $connection) or 
> die(mysql_error());
> 
>         $numRows = mysql_num_rows($result) or die(mysql_error());
> 
> 
>         if ($numRows > 0) {
>                 print("<html><head><link rel=\"stylesheet\" 
> type=\"text/css\" href=\"bbb.css\"></head><body><center><table 
> class=\"outTbl\"><tr><th align=\"center\" class=\"outTh\"> 
> Oops! There are 
> already selections made for $uname in $reg - $rnd. </th></tr> 
> <tr><td>$uname, if you'd like to modify your selections, 
> please click <a 
> href=\"modifyEntry.php\">here</a>.</td></tr></table></center><
> /body></html>");
> 
>                 exit;
> 
>         }
> 
> 
> }
> 
> 
> ?>
> 
> 
> ==============
> 
> When I submit the form, I get a blank screen as a result.  
> There aren't any 
> errors ouput to the screen.  I've compared this with another 
> function I've 
> created, and there doesn't appear to be anything different.  
> The latter 
> works.
> 
> BTW, I bet you'll never guess what this is for...;-)
> 
> Thanks for your help!
> 
> --Joel
> 
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
> http://join.msn.com/?page=features/virus
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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