close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resour

Thread began 7/26/2010 5:16 pm by brad237503 | Last modified 8/02/2010 10:47 am by Eric Mittman | 3852 views | 7 replies |

brad237503

Error Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resour

I am getting the following when attempting to login:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/hhr/public_html/CMS/admin/index.php on line 42

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/hhr/public_html/CMS/admin/index.php on line 44

Any ideas?

New install v1.2

Sign in to reply to this post

Eric Mittman

Do you have a different connection file for live versus local? You normally only get this error when the values referenced on these lines is not in the connection file that is included at the top of the page. If you have different connection files for the live versus the local you will need to update one or the other so that the connection file itself is the same, but the values used in it differ.

For example, if you have a different host, username, password, or db value in the connection file you should update the version you are working with to have the correct values in it. Normally the file just makes use of the values that were entered into the wizard, so if you set it up locally but now want it to be on a live server you will need to update the information that is in this connection file.

Sign in to reply to this post

brad237503

I am able to get to the login screen but when I login that's the message I get. I am on a remote server using localhost. My database, username and password remain the same from my local machine.

Sign in to reply to this post

Eric Mittman

There might be a problem with the location of the connection file on this page. You must ensure that the require_once line for the connection file occurs before any recordset code. If you have any further trouble with this post back with a zip archive of the login page and the page you are trying to go to after logging in so that I can take a look.

Sign in to reply to this post

brad237503

Originally Said By: Eric Mittman
  There might be a problem with the location of the connection file on this page. You must ensure that the require_once line for the connection file occurs before any recordset code. If you have any further trouble with this post back with a zip archive of the login page and the page you are trying to go to after logging in so that I can take a look.  



I remember a full "install" guide when v.1 was available.

I have attached the index file from the admin folder and the connection file.

Thanks

Note: The password has been changed

Attached Files
Files.zip
Sign in to reply to this post

Eric Mittman

The problem is that your connection file has been modified and a key piece has been removed. In the connection file after the values are set you need to have this line of code:

php:
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);



This is what is creating the connection to your MySQL server, the MySQL link resource is then stored in this $localhost variable. On your index page on the line you are getting the error on the code looks like this:

php:
mysql_select_db($database_localhost, $localhost);



It is referencing this $localhost variable that was missing in the connection file. So the error is letting you know that this MySQL resource, $localhost, is not valid.

Sign in to reply to this post

brad237503

That solved the issue; thank you!

Sign in to reply to this post

Eric Mittman

Glad to hear that, let us know if you have any other questions.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...