George Kiraz wrote:
I am running mediawiki on MySQL on a Windows server. I am writing a TAG extension which needs to pull data from a MS SQL data source. In the extension's PHP code, I have the line:
$sqlconnect=odbc_connect($dsn,$username,$password);
When running this PHP code outside of the Wiki (e.g., in the DOS prompt by typing PHP code.php), the connection works and I actually pull out data from the database. But inside the extension code, $sqlconnect ends up being null. Is there a setting that I am missing that allows me to connect to an external database? Is one not allowed to connect to a database in a TAG extension code? (I am new to extensions).
No, there is no setting or anything that should be required. You'll have to debug your code and ensure that you are in fact connecting the way you think.
Are your global variables declared global? Is your PHP configuration the same?
-- brion vibber (brion @ wikimedia.org)