Jump to content

not connecting to mysql server!!


rallokkcaz

Recommended Posts

[code]$dbhost = 'localhost';
$dbusername = '';
$dbpasswd = '';
$database_name = '';

$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") 
    or die ("Couldn't connect to server.");
$db = mysql_select_db("$database_name", $connection)
    or die("Couldn't select database.");
?> [/code]
im using phpmyadmin.
i can't seem to connect to the server.
im not typing anything wrong i can't figure it out!
pleeze help!
Link to comment
Share on other sites

Change your [b]die()[/b] calls to print out the MySQL error you are receiving:

[code]
<?php

$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") 
    or die ("Couldn't connect to server: ".mysql_error());
$db = mysql_select_db("$database_name", $connection)
    or die("Couldn't select database: ".mysql_error());

?>
[/code]

Post back with the error you receive... ;)
Link to comment
Share on other sites

Have you installed PHP locally on your computer? If you have installed PHP5 and you're on Windows you'll need to enable the php_mysql.dll function. If you have PHP4 then it should work. Also if you are not on Windows you'll need to recompile PHP with the --with-mysql command option.

Could you post more information about your PHP setup.
Link to comment
Share on other sites

carnt help you with dreamweaver

But with your connection problems try checking the server address coz some servers dont use localhost I no mine dont mine is [serverurl.com] just check that one that may be your problem

Hope its some help :)
Link to comment
Share on other sites

[quote author=tdnxxx444 link=topic=104306.msg416307#msg416307 date=1155662046]
Looks like you're not connect as any user with any password to any database.  Have you set up these three things on your mysql server?
[/quote]

yes i have i set up a database for users
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.