jivemebaby Posted December 11, 2005 Share Posted December 11, 2005 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 Quote Link to comment Share on other sites More sharing options...
Gaia Posted December 11, 2005 Share Posted December 11, 2005 If you could, post the code you are using to connect. Quote Link to comment Share on other sites More sharing options...
jivemebaby Posted December 11, 2005 Author Share Posted December 11, 2005 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 Quote Link to comment Share on other sites More sharing options...
Gaia Posted December 11, 2005 Share Posted December 11, 2005 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. Quote Link to comment Share on other sites More sharing options...
jivemebaby Posted December 11, 2005 Author Share Posted December 11, 2005 hi, thanks for the info. di have to create a database called sql_tutorial myself? will it matter where i store the database? thanks sh Quote Link to comment Share on other sites More sharing options...
fenway Posted December 24, 2005 Share Posted December 24, 2005 Yes, you have to run a CREATE DATABASE statement, or do it via PHPMyAdmin; and I don't know what you mean by "where" you store the DB. Quote Link to comment Share on other sites More sharing options...
Captain_Pugwash Posted December 24, 2005 Share Posted December 24, 2005 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.