After fiddling about with mySQL functions etc. I've decided on a project to work on.
I've got my functions in a file called functions.php
Each function requires a connection to the database. Rather than open and close a connection for each function I want to open the connection once using an include file called connect.php:
$link = @mysql_pconnect( "localhost", $user, $pass) or die( "Error : ".mysql_error());
mysql_select_db ($db);
//variables substituted for the real values
However despite including this in functions.php or any other file (which also call functions.php), I still get messages
"Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource"
I've searched the forum but nothing I've come across is either pertinent to my query or works (ie. connection in a separate file like I've been trying)
It all works fine if I include these two lines into each function