hi
i am trying 2 connect php with Ms sql .
i get following error :
Warning: mssql_connect(): Unable to connect to server: NEHAL in e:\inetpub\wwwroot\login1.php on line 8
Fatal error: Maximum execution time of 30 seconds exceeded in e:\inetpub\wwwroot\login1.php on line 8
my sample code is :
<?php
$hostname = "NEHAL";
$username = "SA";
$password = "";
$dbName = "erp";
mssql_connect($hostname,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");
$query = "SELECT * FROM users";
$result = MSSQL_QUERY($query);
$number = MSSQL_NUM_ROWS($result);
$i=0;
if ($number == 0) :
print "No data?";
elseif ($number > 0) : print "Data: ";
while ($i < $number) : $name = mssql_result($result,$i,"Name");
print $name;
print " ";
$i++;
endwhile;
endif;
?>
pl. help me to solve this problem
thanks
nehal