Jump to content

i need some serious mysql help!!!!


jamesnshanice

Recommended Posts

Im trying to upload a script to my website and i am having trouble with the mysql.... I have uploaded all of the files

correctly and set permissions, then i go to the link to install (http://www.jobsearchusatoday.com/resume/siteadmin/index.php)

and this is what i get instead of the form: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL

server through socket '

/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/j/a/m/jamesnshanice/html/resume/connect.php on line 3

Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)..... I called my hosting

company (godaddy.com) and they said that i have to set the string in my msql. so i go to my connect.php file and it looks

like this:

<?
//	'server'     'database_username'		'database_password' 
$connection = mysql_connect("localhost", "root", "")
or die (mysql_error());

//	'database_name' 
$db = mysql_select_db("test", $connection) or die (mysql_error());
?> Then i look at an example of what it is suppose to look like and it looks like this: <?php
//Connect To Database
$hostname='jamesnshanice.db.3773677.hostedresource.com';
$username='jamesnshanice';
$password='your password';
$dbname='jamesnshanice';
$usertable='your_tablename';
$yourfield = 'your_field';

mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);

$query = 'SELECT * FROM $usertable';
$result = mysql_query($query);
if($result) {
    while($row = mysql_fetch_array($result)){
        $name = $row['$yourfield'];
        echo 'Name: '.$name;
    }
}
?> 

I just dont understand this stuff at all.... And whats weird is i didnt have this problem last night when i logged of, but

all of a sudden today the problem was there. does anyone know how to fix this?

Link to comment
Share on other sites

Im trying to upload a script to my website and i am having trouble with the mysql.... I have uploaded all of the files

correctly and set permissions, then i go to the link to install (http://www.jobsearchusatoday.com/resume/siteadmin/index.php)

and this is what i get instead of the form: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL

server through socket '

/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/j/a/m/jamesnshanice/html/resume/connect.php on line 3

Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)..... I called my hosting

company (godaddy.com) and they said that i have to set the string in my msql. so i go to my connect.php file and it looks

like this:

<?
//	'server'     'database_username'		'database_password' 
$connection = mysql_connect("localhost", "root", "")
or die (mysql_error());

//	'database_name' 
$db = mysql_select_db("test", $connection) or die (mysql_error());
?> Then i look at an example of what it is suppose to look like and it looks like this: <?php
//Connect To Database
$hostname='jamesnshanice.db.3773677.hostedresource.com';
$username='jamesnshanice';
$password='your password';
$dbname='jamesnshanice';
$usertable='your_tablename';
$yourfield = 'your_field';

mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);

$query = 'SELECT * FROM $usertable';
$result = mysql_query($query);
if($result) {
    while($row = mysql_fetch_array($result)){
        $name = $row['$yourfield'];
        echo 'Name: '.$name;
    }
}
?> 

I just dont understand this stuff at all.... And whats weird is i didnt have this problem last night when i logged of, but

all of a sudden today the problem was there. does anyone know how to fix this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.