phalanger 2.0 , connect to mssql howto
3 posts
• Page 1 of 1
phalanger 2.0 , connect to mssql howto
Hi to all, i am a newbie in use phalanger. I have a script written in php and i try to compile it with Phalanger 2.0 but i have problem with mssql_connect function . Script is simple, here is the code..
<?php
function logs($file_name,$date,$status) {
$conn=mssql_connect('127.0.0.1,1084','homer','test1234');
mssqlselectdb('examle',$conn);
$query1="insert into logs1 values (\"".$file_name."\",\"".$date."\",\"".$status."\")";
$rezq=mssqlquery($upit,$conn);
if($conn) {mssql_close($conn);}
}
}
$fajl="logs.txt";
logs($fajl,date("Y-m-d H:i:s"),1);
?>
then ...
D:\work>"d:\Programs\Phalanger v2.0"\Bin\phpc database2.php
Phalanger - the PHP Language Compiler - version 2.0
for Microsoft (R) .NET Framework version 2.0
Performing compilation ...
database2.php
Generating assembly ...
Build complete -- 0 errors, 0 warnings.
D:\work\bin>database2.exe
Error: Call to undefined function: 'mssql_connect' in D:\razno\php-rad\baza2.php
at expression on line 4, column 1.
There is a library php_mssql.dll in Extension directory and PhpNetMsSql.dll in Dynamic directory. I didn't find any tutorials connecting with this problem... any suggestions?
<?php
function logs($file_name,$date,$status) {
$conn=mssql_connect('127.0.0.1,1084','homer','test1234');
mssqlselectdb('examle',$conn);
$query1="insert into logs1 values (\"".$file_name."\",\"".$date."\",\"".$status."\")";
$rezq=mssqlquery($upit,$conn);
if($conn) {mssql_close($conn);}
}
}
$fajl="logs.txt";
logs($fajl,date("Y-m-d H:i:s"),1);
?>
then ...
D:\work>"d:\Programs\Phalanger v2.0"\Bin\phpc database2.php
Phalanger - the PHP Language Compiler - version 2.0
for Microsoft (R) .NET Framework version 2.0
Performing compilation ...
database2.php
Generating assembly ...
Build complete -- 0 errors, 0 warnings.
D:\work\bin>database2.exe
Error: Call to undefined function: 'mssql_connect' in D:\razno\php-rad\baza2.php
at expression on line 4, column 1.
There is a library php_mssql.dll in Extension directory and PhpNetMsSql.dll in Dynamic directory. I didn't find any tutorials connecting with this problem... any suggestions?
- berekin@codeplex
- Posts: 3
- Joined: January 7th, 2012, 8:56 pm
RE: phalanger 2.0 , connect to mssql howto
create database2.exe.config with following content:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<phpNet>
<classLibrary>
<add assembly="PhpNetMsSql, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03" section="mssql" />
</classLibrary>
</phpNet>
</configuration>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<phpNet>
<classLibrary>
<add assembly="PhpNetMsSql, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03" section="mssql" />
</classLibrary>
</phpNet>
</configuration>
- Duracellko@codeplex
- Posts: 11
- Joined: January 7th, 2012, 8:37 pm
RE: phalanger 2.0 , connect to mssql howto
It works! Tnx Man!
- berekin@codeplex
- Posts: 3
- Joined: January 7th, 2012, 8:56 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 67 guests