Help - Search - Members - Calendar
Full Version: Mysql Error
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
timmsy
Hi all.

im a bitof a noob here. ive done a bit of searchng but cant really fnd an exact answer

ive followed the tut exactly for the registration/login system here: http://www.zymic.com/forum/index.php?showtopic=4034

but keep getting this error:

QUOTE
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /websites/123reg/LinuxPackage21/fu/ll/sc/fullscalefitness.co.uk/public_html/db_connect.php on line 18
Couldn't connect to server.


now at first glance its not connecting to server so ive checked and double checked the db login details are correct.

can somone point me in the right direction. this is the first time ive touched on .php biggrin.gif

thanks
Timmsy
DroNix
that tutorial is old timmsy, shouldn't be using mysql_connect, try at least mysqli. Here's a link to a screencast on how to build a simple login system, it includes the source files too.
Jacob
Even though this tutorial has seasoned a little, I know for a fact it works here on Zymic. The nettuts example is a pretty bad one as it does not explain alot of things that are required.
Could you please paste your source here in [code] tags so we can check it for you?
timmsy
here's the code

it should be the same as the first post in the tut:

CODE
<?php



$dbhost = 'localhost';


// your database username.
    $dbusername = '*****';

// the password that corresponds to the above username.
    $dbpasswd = '*****';

// the database name that your username is associated with.
    $database_name = '*****';

    
    $connection = mysql_connect("$dbhost","$dbusername","$dbpasswd")

    or die ("Couldn't connect to server.");


$db = mysql_select_db("$database_name", $connection)

    or die("Couldn't select database.");


// we write this later on, ignore for now.


include('check_login.php');


?>
DroNix
QUOTE(NaRzY @ Feb 10 2010, 04:40 AM) *
Even though this tutorial has seasoned a little, I know for a fact it works here on Zymic. The nettuts example is a pretty bad one as it does not explain alot of things that are required.
Could you please paste your source here in [code] tags so we can check it for you?


what do you mean by "it does not explain alot of things that are required"? Did you watch the screencast?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.