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

date function help
i need help with date function

Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

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

ALV List display - header width adjust
Hi,

I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

Please Help my PHP Dating Function.
Hi everyone!

Well here is my code that displays this:

It works wonderful.


IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?
I know that maybe it is not as secu

unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:

function getHighes

help with this code please?
Hello,

I am trying to build a remote upload script for my image hosting site.

I am usi

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