Hey I know how to connect to a MySQL DB But i NEED to connect to a MSSQL db on another server. This is what I am using $db = mssql_connect("host", "username", "password"); mssql_select_db ("table", $db); $query = "select top 10 * from vw_Developments"; $result = mssql_query($query); while ($row = mssql_fetch_assoc($result)) { But I am getting this error Fatal error: Call to undefined function: mssql_connect() in /home/***/public_html/***/word/test7.php on line 18 Line 18 is $db = mssql_connect.... Can anyone help
I have checked with them They said I should be able to connect to another hosts db the other hosts has said that I should be able to connect with them
The clue is in the error message, "call to undefined function". This means your copy of PHP doesn't include the necessary extensions to use the mssql_connect function. Basically it doesn't "know" that function. You can double check this with the following: <?php if (function_exists('mssql_connect')) { echo "mssql functions are available in this copy of PHP.<br />\n"; } else { echo "mssql functions are not available in this copy of PHP.<br />\n"; } ?> PHP:
I am currently fighting with my hosting company (again) They say it is nothing to do with them According to the PHP INfo and that script. my version of php is not working with MSSQL I think they are getting confused between MySQL and MSSQL Each time they say that they are right, and I argue it, I always win.
After 10 emails we got an answer. "Unfortunatly we do not support MS SQL on our servers" mmmmm......... OK So i started talking on ICP or ICQ something like that And they wont do anything, it is against there policy So far, these are against there policy, (bare in mind i have only been with them since november) It is against there policy to -; Update PHP Install PDFLIB Add a couple of lines to php.ini to accept code for mssql, not run mssql, just so i can access a remote server holding MSSQL. I like this hosting company......
Please note, for legal reasons. All i have stated is TRUE. This does not class and bad mouthing the company. It just lets people know that if they want a simple package, ok If they want more, and we all want more, then that is my experiance. I have not once said to not use them. (unless that counts)
Your host is just looking out for the overall well-being of their servers. Installing new extensions into PHP isn't something to be taken lightly when the server likely hosts hundreds of other websites. There is lots to consider like security issues with the extension, conflicts with other extensions, how it might impact overall server performance, etc. While installing things can sometimes be as simple as changing one line of code, the ramifications can be much more severe. As someone who provides hosting services, here is how I would deal with it if one of my clients asked for MSSQL. First I would check to see if there was a way around it without reconfiguring PHP, like using PEAR or something. If that didn't work then I would look at things like the security history of the extension, any server performance issues to consider, and if there are any known conflicts with currently running extensions or programs. If all looked good then I would roll out that extension on the next NEW server I brought online. I wouldn't add it to an existing server initially. Add clients to the new server and make sure there are no other, unforeseen problems. If things still went well then I would consider installing the extension on other existing servers as they had scheduled downtime. All of that could take time, however it is done to protect the integrity of the current setup. I may even loose that client because of the delay, but that is okay because if I blindly installed the extension and it caused a conflict I could loose hundreds of clients. In this case I too would say no. Since I don't run SQL Server having a client desire MSSQL support within PHP would be extremely rare. I hope this doesn't sound like a mean analogy, but you are sort of walking into McDonalds and asking for pasta. It just isn't on their menu. They might have the skills and capability to make it, but it just isn't on their menu. Especially since your host doesn't have SQL Server on their servers installing MSSQL extensions wouldn't be often considered.
Macdonalds do pasta. Anyway.. IF they said, we can not set you up for using MSSQL now, but we can look at id further down the line, then OK. But having to argue with staff members saying that it is down to the other host, or my codes, when it was down the them not having it set up pissed me off. Also Lypha meant to specialise in PHP and MySQL, they should have an option on a server for people to move to have the latest version of PHP, come on 4.3.1. They also offer 24hour chat help, more like ask a question and take 24 hour for a responce I am still waiting for a responce from 5 hours ago.
In the UK, I think they do here in spain, don't know, can't remember the last time i had fast food. (In spain, macdonalds, really really is like car tyres) ANyway, whats that got to do with PHP. Lol
I don't really advertise I offer hosting. I have a few servers running to support existing clients, but none of them have MSSQL support now.