You are here: function troubles... « PHP « IT news, forums, messages
function troubles...

Posted by William Stokes on 03/17/05 15:39

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация