RE: [PHP] What's wrong????
| From: | John Holmes | Date: | Tue, 30 Apr 2002 03:55:49 +0000 |
| Subject: | RE: [PHP] What's wrong???? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95300@lists.php.net to get a copy of this message | ||
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:dearpan1974@hotmail.com]
> Sent: Monday, April 29, 2002 5:42 PM
> To: php-general@lists.php.net
> 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