function troubles...

From: Date: Thu, 17 Mar 2005 13:39:00 +0000
Subject: function troubles...
Groups: php.general 
Request: Send a blank email to php-general+get-210977@lists.php.net to get a copy of this message
I don't know whats wrong with this. Can someone help please. <?php require "sql.php"; function shit_func($var) { $sql = "select * from users where sessionid='$sessionid' "; $kys = mysql_query($sql); $user = mysql_fetch_row($kys); $k_tun = $user[0]; $ok1 = $user[4]; $ok2 = $user[5]; $ok3 = $user[6]; $ok4 = $user[7]; $ok5 = $user[8]; $ok6 = $user[9]; $ok7 = $user[10]; echo "$var"; echo "$k_tun"; echo "$ok1"; echo "$ok2"; echo "$ok3"; echo "$ok4"; echo "$ok5"; echo "$ok6"; echo "$ok7"; } $test=shaisse; shit_func($test); ?> This will print: "shaisse" but nothing else. I need to know why the other variables won't print. The sql query worksand echoes work if not used in function. I tested it in an other file and it worked but when I put it in a function it doesn't work. Help Appreciated! Thanks -Will

« previous php.general (#210977) next »