Member registration scripts cause DB error

apps

#1

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/.ufowasherkiln/colourdreams/colourdreams.com/signup.php on line 74

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/.ufowasherkiln/colourdreams/colourdreams.com/signup.php on line 76

I’m wondering if this has something to do with Dreamhost not liking those itself?

What can I do?


#2

[quote]Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/.ufowasherkiln/colourdreams/colourdreams.com/signup.php on line 74

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/.ufowasherkiln/colourdreams/colourdreams.com/signup.php on line 76

I’m wondering if this has something to do with Dreamhost not liking those itself?[/quote]
Perhaps the script cannot log into the MySQL server. Try confirming that the credentials are correct by logging into phpMyAdmin. If they are not, check the Web Panel to see that you have the database setup with a user and hostname, and if anything appears fishy contact support.

The script is probably doing something like:
$dbh = mysql_connect($hostname, $username, $password);
mysql_select_db($database_name, $dbh);
$rows = mysql_query($query_statement, $dbh);

and when it should be like:
$dbh = mysql_connect($hostname, $username, $password);
if (!$dbh) {
echo “ERROR - unable to connect to MySQL server\n”;
echo mysql_error();
exit;
}
mysql_select_db($database_name, $dbh);
$rows = mysql_query($query_statement, $dbh);

The idea is that it should tell you there was an error instead of letting PHP dump its own error messages. If the connection was unsuccessful, the script should not be trying to use $dbh anymore.

:cool: Perl / MySQL / HTML+CSS