I am running Wamp5 V1.4.4
Im relativley new to PHP/MySQL etc.
I am getting what i consider wierd issues with
variables being cleared.
***** Test.php ***
include ("./sqlfunctions.php"

// have code that sets up a variable called $statment.
$statment = "select * from debtors"
$res = sql($statment) // user function call
**** sqlfunctions.php ****
function sql($statment,$assoc=1)
{
echo $statment // correctly gives me select * from debtors
// connect to DB
If (!mysql_connect(host,user,pass))
{
echo "error" . mysql_error();
exit;
}
echo $statment // this now gives me nothing - variable contents seemed to
// have been cleared??
// when i try to use $statment in actual qry - i get "empty qry" error.
.
.
.
}
So - any obvious mistakes here??
on the surface, it look like calling mysql_connect unsets my variable??!!
Or is this something to do with .ini settings or something?
some wierd vagery of my WAMP5 version?
If i use the EXACT same mysql code inline instead of using a function call,
it all seems to work as expected.
Thing that annoys me is that im told this style of coding works on
someones production LAMP environment!!
regards
Ian.