Error connecting to mysql w/ php

software development


at I receive supplied argument is not a valid MySQL result resource

I have always fixed that by correcting some error I made with the db location, user or pass. In this case I think they are all correct. (especially since I can go to with that user and pass just dandy)

It has been 9 or 10 months since I installed something on dh. This thing works just dandy locally, but it gives me that error when I use it now.

I have searched the forum, and it seems oh so very familiar but I can’t pinpoint it. Permissions? It must be something simple that I am just not seeing having looked at it too long.

The inc starts

<?php function db_connect() { $conn = mysql_connect('', 'user', 'pass'); mysql_select_db('Acronyms'); return $conn; } function db_disconnect() { mysql_close(); return 0; } Any ideas... probably something obvious, but I think I have tried all the things I usually use to fix these.


[quote]$conn = mysql_connect(‘’, ‘user’, ‘pass’);

Any ideas… probably something obvious, but I think I have tried all the things I usually use to fix these.[/quote]
…well its obvious you’re not calling mysql_error, doing so might help solve the problem.

:cool: -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


Double check that the details for the hostname user and password are correct especially where case is concerned.

Also are you calling the correct and existing database name. i.e. The one you think you are :slight_smile: .

I believe that unlike in Windows the database name is case sensitive.


Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK! :@

Act on my advice at your own risk!


Exactly I was trying to use db named Acronyms and the db is named acronyms. It was a case thing.

Thanks for making me triple check and find that.

It is always the easy things.