I am using this code to connect to a db
@$conn = mysql_connect("localhost",$dbUserName, $dbPassword) or die("An error occured whilst connecting to the database.\n");
@mysql_select_db($dbName) or die("Could not select database on host");
//check to see if page is in database
$sql="select id from pages where name = \"$name\";";
$result = mysql_query($sql) or die("Query failed");
this is in the global scope of the script, i then have a function in the same script that also needs to runa sql query on the same connection, how do i do this, how do i make the connection global or accessable to the function.
thanks in advance kieran