I am receiving the following error and it makes no sense to me:
Warning: Supplied argument is not a valid MySQL-Link resource in /web/rkc-lan/regplayers.php on line 73
Warning: Supplied argument is not a valid MySQL-Link resource in /web/rkc-lan/regplayers.php on line 75
The code that is having a problem is as follows:
<?php
function email_unpaid() {
mysql_select_db($database_rkclan_db, $rkclan_db);
$query_rsUnpaidPlayers = "SELECT name, email, paid FROM signup WHERE paid = 0";
$rsUnpaidPlayers = mysql_query($query_rsUnpaidPlayers, $rkclan_db) or die(mysql_error());
$row_rsUnpaidPlayers = mysql_fetch_assoc($rsUnpaidPlayers);
$totalRows_rsUnpaidPlayers = mysql_num_rows($rsUnpaidPlayers);
echo $totalRows_rsUnpaidPlayers;
do {
email($row_rsUnpaidPlayers['name'], $row_rsUnpaidPlayers['email']);
} while ($row_rsUnpaidPlayers = mysql_fetch_assoc($rsUnpaidPlayers));
mysql_free_result($rsUnpaidPlayers);
}#end function email_unpaid
?>
The lines that are causing the issue are:
mysql_select_db($database_rkclan_db, $rkclan_db);
$rsUnpaidPlayers = mysql_query($query_rsUnpaidPlayers, $rkclan_db) or die(mysql_error());
Now if I remove this code from being called in a function and just let it execute as the page runs it works like a charm. The top of the page has a require_once statement linking it to the database information. I am not finding anythat looks wrong here. I did try to change the statement of die(mysql_error()) to die(mysql_errno()) and the error number returned was 0.
Any help would be greatly appreciated!