Folks ,
AM trying to make connection with the Northwind database(SQL server 2000 usiung PHP but i get this error . Help me , am begineer
***********************************************************
Warning: odbc_connect(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection., SQL state 28000 in SQLConnect in c:\web\odbc_connection.php on line 2
Connection Failed:
**********************************************************
************************************This is my code *********
<html><body><?php
$conn=odbc_connect('northwind','','');
if (!$conn)
{
exit("Connection Failed: " . $conn);
} $sql="SELECT * FROM customers"; $rs=odbc_exec($conn,$sql); if (!$rs)
{ exit("Error in SQL");
} echo "<table><tr>";echo "<th>Companyname</th>";
echo "<th>Contactname</th></tr>";while (odbc_fetch_row($rs))
{$compname=odbc_result($rs,"CompanyName");$conname=odbc_result($rs,"ContactName");echo "<tr><td>$compname</td>";echo "<td>$conname</td></tr>";}
odbc_close($conn);echo "</table>";?></body></html>
AM trying to make connection with the Northwind database(SQL server 2000 usiung PHP but i get this error . Help me , am begineer
***********************************************************
Warning: odbc_connect(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection., SQL state 28000 in SQLConnect in c:\web\odbc_connection.php on line 2
Connection Failed:
**********************************************************
************************************This is my code *********
<html><body><?php
$conn=odbc_connect('northwind','','');
if (!$conn)
{
exit("Connection Failed: " . $conn);
} $sql="SELECT * FROM customers"; $rs=odbc_exec($conn,$sql); if (!$rs)
{ exit("Error in SQL");
} echo "<table><tr>";echo "<th>Companyname</th>";
echo "<th>Contactname</th></tr>";while (odbc_fetch_row($rs))
{$compname=odbc_result($rs,"CompanyName");$conname=odbc_result($rs,"ContactName");echo "<tr><td>$compname</td>";echo "<td>$conname</td></tr>";}
odbc_close($conn);echo "</table>";?></body></html>