You don't have MSSQL support in your PHP installation. Uncomment the line in PHP.ini that loads the MSSQL .dll
Use a phpinfo() file to see what modules are loaded. You're making this hard on yourself...PHP is easy to learn. ---John Holmes... > -----Original Message----- > From: Arpan De [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 29, 2002 5:42 PM > To: [EMAIL PROTECTED] > Subject: [PHP] What's wrong???? > > What is wrong with the following code? > > <?php > $connection=mssql_connect("SQLServerName","sa","") > or die("Couldn't make connection"); > > $db=mssql_select_db("DBName",$connection); > $sql="SELECT FName,LName,UserID FROM tblName ORDER BY FName"; > > $sqlResult=mssql_query($sql,$connection); > > while($row=mssql_fetch_array($sqlResult)){ > $firstname=$row["FName"]; > $lastname=$row["LName"]; > $userid=$row["UserID"]; > > echo("<tr>"); > echo("<td>$firstname</td>"); > echo("<td>$lastname</td>"); > echo("<td>$userid</td>"); > echo("</tr>"); > } > > mssql_free_result($sqlResult); > mssql_close($connection); > ?> > > When the above code is executed, I am getting the following error: > > Fatal error: Call to undefined function mssql_connect() > > which points to the 2nd line in the code. Even the die() function doesn't > get executed. I just copied & pasted the code from a tutorial I found on > the > web but am still getting this error !!! Is learning PHP so frustrating? I > have never encountered such frustration while learning any other software > languages. It's making me too dependent on this newsgroup !!! Sometimes it > does happen that in other languages, if you are getting an error, one can > overcome that particular error by employing some trial & error methods but > whatever & whenever I have tried to do the same in PHP, I could never > overcome the error. > > Thanks, > > Arpan > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php