cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to SQL

greenofashbourn
Grafter
Posts: 50
Registered: ‎22-03-2009

Connect to SQL

Hi,
I'm sure I'm being dim, but can't work this one out!
I'm trying to use php in my ccgi space to connect to my SQL database, but I can't seem to make it work.
I'm currently using the following - I'm assuming it's the $server definition that's not correct but I don't know what to change it to!
$server = "rumpus";
$user = "greenofashbourne";
$pass = "password";
$database = "greenofashbourne_pn";
$connection = mssql_connect($server, $user, $pass)

Any help appreciated.
Thanks,
Stuart
5 REPLIES 5
Peter_Vaughan
Grafter
Posts: 14,469
Registered: ‎30-07-2007

Re: Connect to SQL

The password is not the same as your account password, it is created when you activated MySQL and included in the email that is sent to you after activation.
If you can't remember it just disable MySQL and enable it again and wait for the email with the connection details.
greenofashbourn
Grafter
Posts: 50
Registered: ‎22-03-2009

Re: Connect to SQL

Amazingly, I have got the email with the database password on it - so I know that is correct (and I can log into the SQL through PHPMyAdmin - I just can't use it with a .php file called from ccgi.greenofashbourne.plus.com).
Thanks,
Stuart
Peter_Vaughan
Grafter
Posts: 14,469
Registered: ‎30-07-2007

Re: Connect to SQL

try rumpus.plus.net
greenofashbourn
Grafter
Posts: 50
Registered: ‎22-03-2009

Re: Connect to SQL

Thanks! That worked (after also spotting that I needed to change mssql to mysql!)
Cheers,
Stuart
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Connect to SQL

"rumpus" alone would probably work after correcting the name of the "connect" function. Cool
David