Mssql

_jamz

New Member
Messages
3
Reaction score
0
Points
0
Hi friends, I'm currently running a MSSQL on my computer, and when i try to connect the database via a php script all i got is a blank white php page. Any idea what when wrong?... Or is there some additional component i need to install so that my computer can allow php access or smth?... :dunno:

Code:
<?php
$dbhost = "theIPgoeshere"; $dbuser = "theusernamegoeshere"; $dbpass = "thepasswordgoeshere";
@mssql_connect($dbhost,$dbuser,$dbpass)or die("error");
@mssql_select_db("test2")or die("error");
?>
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Remove the @'s so you can view the error occurring.
 
Last edited:

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
Do you have PHP, Apache and MSSQL installed on your computer? If not, you will need to install Apache / PHP and its extensions (Google for LAMP).
 

_jamz

New Member
Messages
3
Reaction score
0
Points
0
Do you have PHP, Apache and MSSQL installed on your computer? If not, you will need to install Apache / PHP and its extensions (Google for LAMP).

I upload the php files on my x10 account.

Remove the @'s so you can view the error occurring.

Here's what i got:
Fatal error: Call to undefined function mssql_connect() in /home/jamzonli/public_html/test.php on line 3

Any idea whats the problem?... :happysad:
 
Last edited:

S_W_A_T

New Member
Messages
292
Reaction score
0
Points
0
I got the same problem too... Does that mean we cant connect to MSSQL till x10 server has that extension installed on the server?...
 
Last edited:

YamiKaitou

Member
Messages
636
Reaction score
0
Points
16
x10 would need to install the MSSQL server on their servers, which I don't think they will do.
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
If I am right in saying MSSQL stands for Microsoft SQL or something like that??

wouldnt it be easier to use the MySQL in cPanel, then perform the connection using this:

PHP:
// Enter the username here. Can be the main admin username or an account you assigned to it earlier.
$sql[username] = "username here"; 

// Enter your password here. Again can be done using admin password or the account you assigned to the db in the mysql manager in cPanel.
$sql[password] = "password here";

// Should be left at localhost. This should work.
$sql[hostname] = "localhost";

// Normally begins with your username. Example: zenax_website
$sql[db_name] = "name of db here" 

// Performs a connection to the SQL host, and if there is an error should display the error message
$connection = mysql_connect($sql[hostname], $sql[username], $sql[password]
or die ("Sorry cannot connect to the SQL server");

// Selects the database specified above. Uses the connection created earlier, if not shows error message
$db_select = mysql_select_db($sql[db_name], $connection)
or die ("Sorry cannot connect to the DB on the SQL server. Please check your configuration settings");
 
Last edited:
Top