Jump to content

Recommended Posts

hi,

 

im having terrible trouble connecting php and mysql. i cant seem to get them to work together. i keep getting error messages such as:

 

Warning: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\phpdev\private\signupck.php on line 26

 

Warning: MySQL Connection Failed: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\phpdev\private\signupck.php on line 26

Could not connect to MySQL

 

am i suppose to put all the files in the same location? i really dont know what im doing wrong, new to php :)

 

any asisstance would be much appreciated.

 

Thanks,

 

SH

Link to comment
https://forums.phpfreaks.com/topic/3021-connecting-php-and-mysql/
Share on other sites

hi,

 

i downloaded this tutorial:

 

[a href=\"http://www.plus2net.com/php_tutorial/php_signup.php\" target=\"_blank\"]PHP member signup script using mysql[/a]

 

it contains all the files. but when i tried to run it on my localhost, and typed in info into the signup page, i was given the following error:

 

Warning: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\phpdev\www\public\signupck.php on line 26

 

Warning: MySQL Connection Failed: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\phpdev\www\public\signupck.php on line 26

Could not connect to MySQL

 

im not sure what i did wrong. any suggestions as to how im suppose to connect the database? if you can help that would be great!

 

THanks,

 

SH

 

 

This isn't really the place for third party scripts.

 

But, open up all the files that you download and at the top you should see something like tihs:

 

$dbservertype='mysql';
$servername='localhost';
// username and password to log onto db server
$dbusername='';
$dbpassword='';
// name of database
$dbname='sql_tutorial';

 

You need to fill those variables in with your information.

  • 2 weeks later...

Firts off do actually have MySQL installd & then have you created your database. I do this sounds like a stupid question, but i've seen it happen.

 

If you have the standard

$db = mysql_connect(host, username,passowrd ) should get you a connection to mysql. You then have to connect to the actual database using

mysql_select_db(DbName,$db)

 

and then you're off. if you don't have mysql or you are having trouble creating a databse come back to us

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.