Connecion issue


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

For some reason, I keep getting this error when trying to connect:

Did you know?Explore Trending and Topic pages for more stories like this.
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on...
Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket...
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established...

This is my php code:


<?php
//database connection settings
$db_username = "test";
$db_password = "test";
$db_host = "test";
$db_name = "test";

$connection = mysql_connect($db_username, $db_password, $db_host);
if(!$connection){
echo"Cannot connect to database! Please check the settings";
}

else{
echo"Database Connection Successful";
}

mysql_select_db($db_name);
echo"Database Connection Successful";

?>


Any ideas whats wrong?
No comments posted yet

Your Answer:

Login to answer
173 Like 32 Dislike
Previous forums Next forums
Other forums

help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted de

php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]

Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief t

getting Vars to pass to next page.
Hello all,
I have a confusing situation on my hands, i am a member of a gaming community and we

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

Customizing message/behavior
Hi,I'm using the ASP.NET membership/authorization controls in my application. Some parts of my appli

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

Files in current folder. Should be an easy fix.
Never mind. I've asked about this before and just found my answer. Anyway to delete this?

Varible in trigger - refering to correct schema
Hello

Im having some issues with my trigger.
What I want to do is call opon a differ

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash