Ok its a little tidier but the same core error still occurs.
In answer to your question the DB call is in an include elsewhere in the script that looks like this
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "dev";
$username_localhost = "root";
$password_localhost = "password";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or die(mysql_error());
?>
I call the function directly by placing
Language("OriginalTextHere","newisovaluehere")
This should do a lookup in my language table to try to find the match for the original text (in english) and the new text. E.g.
Language("Welcome","de")
should return Willkommen
Because my lang table contains a row with the following info
|iso|originaltext|newtext
|de|Welcome|Willkommen
However I get an error response
"Warning: Supplied argument is not a valid MySQL-Link resource in path/to/file..." on these two lines:
mysql_select_db($database_localhost, $localhost);
and
$getNewTextbyLanguage = mysql_query($query_getNewTextbyLanguage, $localhost) or die(mysql_error());
But I cant see where the issue is as the db code only fails when placed inside the function. When placed outside the function its fine, but obviously the function wont work as it needs to be able to dynamically look up words/phrases on a regular basis as it parse out a page
Any more ideas ???