Connecting Register page to database
I know I am missing a step and not sure what it is to connect a register page to the database, my setup is as follow
The server itself runs fine people can connect blah blah blah so no I'm not stuck at that XD
I have enabled the protocol tcp/ip in the sql config manager.
I have a website running apachie with php ( I have tried xaamp also but seems it still dose not what to connect to the database but I feel that I am missing something to get it to connect on the web end
Yes I have opened the firewall port and tested that also
I have been using this to test if it is able to even try and talk to the sql with no luck
Code:
<?php
if (function_exists('mssql_fetch_row')) {
echo "MSSQL functions are available.<br />\n";
} else {
echo "MSSQL functions are not available.<br />\n";
}
?>
(( I know this dose not test the connection to the database it only sees if it can even try and talk to a sql server at all))
So I guess I'm just asking for some pointers I have tried to install the ms sql driver also and seems now it says my php5.dll is not there for whatever reason I guess all and all I'm at wits end and would like a few pointers to give me new hope to keep trying x.x
Re: Connecting Register page to database
You should never open your db for remote connections without IP filters.
Re: Connecting Register page to database
Quote:
Originally Posted by
0M3GA
I know I am missing a step and not sure what it is to connect a register page to the database, my setup is as follow
The server itself runs fine people can connect blah blah blah so no I'm not stuck at that XD
I have enabled the protocol tcp/ip in the sql config manager.
I have a website running apachie with php ( I have tried xaamp also but seems it still dose not what to connect to the database but I feel that I am missing something to get it to connect on the web end
Yes I have opened the firewall port and tested that also
I have been using this to test if it is able to even try and talk to the sql with no luck
Code:
<?php
if (function_exists('mssql_fetch_row')) {
echo "MSSQL functions are available.<br />\n";
} else {
echo "MSSQL functions are not available.<br />\n";
}
?>
(( I know this dose not test the connection to the database it only sees if it can even try and talk to a sql server at all))
So I guess I'm just asking for some pointers I have tried to install the ms sql driver also and seems now it says my php5.dll is not there for whatever reason I guess all and all I'm at wits end and would like a few pointers to give me new hope to keep trying x.x
Ok
1. You don't need to enable tcp thing on sql server or open your firewall port. (Unless the database is on remote computer).
2. MSSQL does not work with PHP 5. Or it might work but either way I'd recommend downloading Microsoft's PHP drivers, which don't even use mssq_ anymore, it's sqlsrv_.
You can find all of the information you need here. Microsoft Drivers for PHP for SQL Server
Thus said if the script you use still uses mssql_ you can try to get it to work, or download an older xampp version with PHP4.
Re: Connecting Register page to database
Just before I came back I read this
php_mssql compiled for PHP 5.3 - windows_xp
Witch pretty much so explained why I am having this problem.
So best suggestion would be to just get an older version of php and use that as it would work better for the needs of the code, Question thou why did they decide to drop support for this?
I still wish the db could be linked to a mysql server rather then mssql server would make things SO much easier.
Re: Connecting Register page to database
No best suggestion is not to get an older PHP version. Well it is if you don't know PHP. If you do, just get the PHP5 drivers from microsoft and make your own script. I have it working on IIS7 and the newest xampp.
Re: Connecting Register page to database
May I ask why you choose to use xampp? I feel updating mysql php/Apache would be easier if they were all installed in their own ways rather then install it as one package.
But I suppose it all being together helps development also, I guess they both have their ups and downs XD
Thankyou for the help also I haven't had time to start up on this yet but I will soon and try and get everything working :D
Re: Connecting Register page to database
I only use xampp for the mysql since it's basically drag and drop set up, or if I'm making a script for someone and they use xampp I like to make it in their environment not mine which would be IIS.
Re: Connecting Register page to database
That is true, ensures everything will work with what they have and less debugging after.
What advantages dose IIS have over xampp?
Re: Connecting Register page to database
Well back again, After taking some time to understand witch set of .dll's I needed for the sqlsrv functions and installed the native client, I was attempting to use an old register page made by c# was wondering if anyone else has had this problem or is it the fact it was coded only to work with the old system?
I have changed the connection system over to the new functions to update it rather then mssql to sqlsrv
Code:
Notice: Use of undefined constant step2 - assumed 'step2' in ((FILE LOCATION)) on line 2 Catchable fatal error: Argument 2 passed to sqlsrv_connect() must be an array, string given, called in ((FILE LOCATION)) on line 3 and defined in ((FILE LOCATION)) on line 17
changed the file locations only for the post to make it shorter and make it cleaner, both problems are with the register_do.php
Also yes my webserver and privserver are on 2 different computers
Re: Connecting Register page to database
Re: Connecting Register page to database
Fixed the issue connecting to the database the sql server browser was not enabled, thank you for all the help, I will soon be working on a newer register page and from there I will upload a newer register page and maybe even a guide on how to do this to prevent the hell I went thu
x.x
Thanks to
Bakey :D
I feel people who help should get the recognition they deserve
Re: Connecting Register page to database
Here's a page I made a while back if you'd like to use, I was messing with sqlsrv things and zend studio when I made it.
Should work on xammp (new one with php 5) if you hook up the windows php driver for it.
Same goes for IIS7.
Click