Current location: Hot Scripts Forums » Programming Languages » PHP » MySQL Query Failed


MySQL Query Failed

Reply
  #1 (permalink)  
Old 01-02-12, 08:22 PM
sheldon73521 sheldon73521 is offline
New Member
 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL Query Failed

This is my first time using PHP can somebody tell me what ive done wrong. Thanks

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'scrossbuilder@72'@'184.168.46.160' (using password: YES) in /home/content/08/8778708/html/storescripts/connect_to_mysql.php on line 19
could not connect to mysql

<?php
// Created BY Adam Khoury @ Adam Khoury - 6/19/2008
/*
1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions.
2: A "mysql_connect()" error usually means your username/password are wrong
3: A "mysql_select_db()" error usually means the database does not exist.
*/
// Place db host name. Sometimes "localhost" but
// sometimes looks like this: >> ???mysql??.someserver.net
$db_host = "scrossbuilder.db.8778708.hostedresource.com";
// Place the username for the MySQL database here
$db_username = "scrossbuilder@72.167.233.37";
// Place the password for the MySQL database here
$db_pass = "**********";
// Place the name for the MySQL database here
$db_name = "scrossbuilder";

// Run the actual connection here
mysql_connect("$db_host","$db_username","$db_pass" ) or die ("could not connect to mysql");
mysql_select_db("$db_name") or die ("no database");
?>

I hope this is all you need if not please let me know. Thanks
Reply With Quote
  #2 (permalink)  
Old 01-03-12, 06:22 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Your code does give you a little hint.

Quote:
2: A "mysql_connect()" error usually means your username/password are wrong
Are you sure your username should look like this: scrossbuilder@72.167.233.37 ...? Try removing the @72.167.233.37 part.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JS script not working properly on IE but working on Firefox!!! sujata_ghosh JavaScript 4 05-21-07 05:46 AM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 08:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.