Jump to content

Warning: mysql_select_db(): supplied argument is not a valid


chiefrokka

Recommended Posts

I have someone installing my script on their server and their getting the error: 

 

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/blahblahblah/public_html/pickem/config.php on line 11

 

my config.php is

<?php

//make changes accordingly to your database
$hostname = "hostname";
$database = "database name";
$username = "username";
$password = "password";
// only change the above information to reflect the database you created on your hosting site

$db = mysql_connect($hostname, $username, $password); 
$db_select = mysql_select_db($database, $db) or mysql_error();
?>

 

I had someone else have this same problem but I realized they were using mysql 4.1 and I'm using 5.0 on GoDaddy.  This latest server config that's giving same issues seems to be fine though? 

 

Apache version 2.2.8 (Unix)

PHP version 5.2.6

MySQL version 5.0.51a-community

Architecture i686

Operating system Linux

 

 

My GoDaddy is using php 4.1 and mysql 5.0 and the scripts work great as well as it does on other servers except this guys. 

 

any suggestions? 

 

 

 

Link to comment
Share on other sites

he got error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ccteamoh_wrqk'@'alexandria26.2mhost.com' (using password: YES) in /home/ccteamoh/public_html/pickem/config.php on line 10

Access denied for user 'ccteamoh_wrqk'@'alexandria26.2mhost.com' (using password: YES)

 

Link to comment
Share on other sites

weird.  I checked and everything seems correct.  I had him make another db and user and still same error. 

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ccteamoh_wrqk2'@'alexandria26.2mhost.com' (using password: YES) in /home/ccteamoh/public_html/pickem/config.php on line 10

 

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/ccteamoh/public_html/pickem/config.php on line 11

Link to comment
Share on other sites

Sounds like communcation from the webhost may have a problem to the DB.  Same webhost for the php as the mysql?  Do they have restrictions?  I know Godaddy won't let you use mysql with their windows servers, only their Unix/Linux ones.  Maybe their host has a similiar restriction.

 

Don't use the IP of the mysql host either, many times they give you a special servername to use for the mysql servers.

Link to comment
Share on other sites

ya, I checked and it's linux as I had that problem with GoDaddy's Windows before.  I'm using the hostname not the ip as well.  I just deleted the db myself and usernames and redid everything but still getting error. 

 

if it's not my syntax I have no clue as I've confirmed everything is right.  oh well.  thanks anyways guys

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.