Hi,
For some reason, I keep getting this error when trying to connect:
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?
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called "a"Code: private function fileOpenMethod($filePath,
Embed Video Problem
Hey, thanks for looking!File to be embedded:Code: <playlist version="1"><trackList><track><title>SOCCER -
Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything.Code: <td class="row3"><input type="text"
Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the string, probably separated by a comma, and print them out, like this:word 1: xxxxword 2: xxxxword 3:
Multi Dimensional Array Append
Hi Guys I have a function that returns a multidimentional array eg $result = function(param)echo $result[0][1]." ".$result[1][1]but I want to call the function 4 diffrent times and append to
Most basic form question ever?
Hello,I want to use this snippet to make sure the fields in a form are ok before processing it.Code: <FORM method="post">To:<input type="text"
How to insert random unique values in 2 columns ?
I have table with 2 columns
BIG file upload!
Hey guys!I'm trying to upload a file, it works well with smaller files but with 60mb+, I get a POST size error even though I've raised POST max size:Code: ini_set( 'post_max_size', '500M' );This error
Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programmer screwed up for a site that I have. Let me explain what the current issue is. I believe it had to
session variable problem
Session variable is not working in Fire fox i am getting null value but it is working fine in IE.any one can help me to resolve this issue..