p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: mssql_connect() - Urgent


Message #1 by "vidya" <vidya_kgg@y...> on Fri, 14 Dec 2001 16:08:19
Hai all



  I am new to PHP. I need to connect to MSSQL using PHP.



  While i am connecting to MSSQL i am receiving the error



  message given below. Can any one help me in this.



 

Fatal error: Call to undefined function: mssql_connect()





my code to connect MSSQL.



<html>

<body>



<?php



$HOST = "192.168.0.5"; 

$USER = "sa"; 

$PSW = ""; 

$DB = "Jvccons"; 

if (mssql_connect($HOST, $USER, $PSW)) 

{ 

mssql_select_db($DB); 

echo mssql_result( mssql_query("SELECT * from Countries"), 0, 0); 

} 

if (!mssql_close()) 

echo "No lo pudo cerrar"; 



?>

<body>

</html>
Message #2 by Oils of Nature - Administrator <Administrator@o...> on Fri, 14 Dec 2001 21:42:34 +0100
Hya, 



Have you editted you php.ini so that the extension fof mssql is uncommented

?

---------------------sample from php.ini--------



extension=php_mssql.dll



---------------------End sample-----------------



I also use MSsql and in my connection( $host = "<computername>") i use the

computername.



two suggestions about your problem... 

hope they give you the solve.



Michael Honkoop



-----Oorspronkelijk bericht-----

Van: vidya [mailto:vidya_kgg@y...]

Verzonden: Friday, December 14, 2001 17:08

Aan: beginning php

Onderwerp: [beginning_php] mssql_connect() - Urgent





Hai all



  I am new to PHP. I need to connect to MSSQL using PHP.



  While i am connecting to MSSQL i am receiving the error



  message given below. Can any one help me in this.



 

Fatal error: Call to undefined function: mssql_connect()





my code to connect MSSQL.



<html>

<body>



<?php



$HOST = "192.168.0.5"; 

$USER = "sa"; 

$PSW = ""; 

$DB = "Jvccons"; 

if (mssql_connect($HOST, $USER, $PSW)) 

{ 

mssql_select_db($DB); 

echo mssql_result( mssql_query("SELECT * from Countries"), 0, 0); 

} 

if (!mssql_close()) 

echo "No lo pudo cerrar"; 



?>

<body>

</html>




$subst('Email.Unsub').

Message #3 by kwan pei quen <peiquen@y...> on Mon, 17 Dec 2001 03:38:23 -0800 (PST)
hi i am also new in PHP but i have finish my final

year project using PHP with MSSQL



anyway, i found that odbc connection have more

function compare to mssql 



currently i have no information with me, the next time

i online i try to mail it for you 



happy learning ...



__________________________________________________

Do You Yahoo!?

Check out Yahoo! Shopping and Yahoo! Auctions for all of

your unique holiday gifts! Buy at http://shopping.yahoo.com

or bid at http://auctions.yahoo.com


  Return to Index