PHP, MSSQL and Delphi
- From: "Melinda" <melindabellei@xxxxxxxxx>
- Date: 30 Jun 2005 13:43:34 -0700
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,
.
- Prev by Date: Re: SpyBot S&D written in Delphi
- Next by Date: Re: Unofficial patch for QC#14007
- Previous by thread: D7 - a/v when close
- Index(es):
Relevant Pages
|