ok i have made a function to get 2 variables, im having no problem echoing the variables if i place the echo's in the function but if try to echo them from outside the function it won't play ball:
heres my code:
<?php
function Get_Auth_Test()
{
$testserver = "mysql.dth-scripts.com";
$testdb = "files";
$testuser = "admin";
$testpass = "qweasd";
$testtable1 = "Registrations";
$cdir = basename(getcwd());
$testconn = mysql_connect($testserver,$testuser,$testpass);
if (!$testconn) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$testdb", $testconn) or die("Unable to select database '$testdb'");
$testquery = "SELECT * FROM $testtable1 WHERE folder='$cdir'";
$testresult = mysql_query($testquery) or trigger_error("SQL", E_USER_ERROR);
while ($testb = mysql_fetch_array($testresult)){
$testfolder = $testb['folder'];
}
<-- if i place echo's here they work fine?
}
Get_Auth_Test();
echo $testfolder; /produces didly squat
?>