PHP, MSSQL and Delphi




Hi, i'm writing an application which is getting the data from the http requests and save them into an MSSQL Server. Then i'm planning to use this data from Delphi. But the problem is my PHP scripts seems not working. I found some examples from internet but i couldn't make them work too. I have AppServ installed on my machine(local) and MSSQL 2000. Here is the code that i couldn't make it work :
---------------------------------------------
<?php
$myServer = "cannb";
$myUser = "sa";
$myPass = "";
$myDB = "Northwind";

$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");

if ($d)
{
echo('Yes');
}
else
{
echo('No');
}

$query = "SELECT TitleOfCourtesy+' '+FirstName+' '+LastName AS Employee ";
$query .= "FROM Employees ";
$query .= "WHERE Country='USA' AND Left(HomePhone, 5) = '(206)'";

$result = mssql_query($query);
$numRows = mssql_num_rows($result);

echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";

while($row = mssql_fetch_array($result))
{
echo "<li>" . $row["Employee"] . "</li>";
}
?>
-------------------------------------------------------

Could you please provide me a little PHP script which can access to MSSQL Server and get some portions of data. I really need it...

Thank you,

Kind Regards,
.



Relevant Pages

  • Re: Who is using PHP today?
    ... The Object Oriented functionality new to PHP since I used it ... sense that our server is Windows 2003 and our DB is SQL Server. ... Regards the finger pointing thing....have you ever dealt with Microsoft to ... ASP, half that, C# about 100 million. ...
    (comp.lang.php)
  • Re: [PHP] ODBC and long text fields
    ... We've a PHP app that uses ODBC to talk to a MS SQL server. ... The internal code for a query is ...
    (php.general)
  • Re: ODBC, Linux, Win2k - how to automate DSN setup?
    ... > I need to access databases on both win2k and Linux systems but I have to set ... TDS is the native protocol of SQL Server 6.5, 7, and 2K. ... have another database out there on the Windows platform that you ... You'll need to find out how to recompile PHP and Apache with mssql ...
    (comp.lang.php)
  • about SQL authentication on PHP
    ... I'm trying to connect to a SQL Server database with PHP using windows auth. ... public function GetType() ... class Child implements Parent ...
    (php.general)
  • Re: Cant alter data in primary key fields
    ... When you say you're trying to update it, is that just within PHP pages? ... >> Now if I try to alter the 0.33 to any value it just reverts back to the ... what SQL server do you use? ... > You can try the ALTER to modify the table so that the column no longer ...
    (alt.php)