I have a forum I am working on integrating two separate tables with - and am getting the following error:
Warning: Supplied argument is not a valid MySQL result resource in /www/bladekeep/forum/dmin/editchar.php on line 48
Now the line this is referring to is as follows:
if ($myrow = mysql_fetch_array($charnames)) {
Below is the code...do any of you see anything glaringly wrong with this? I am not sure why the code is no longer functioning (I upgraded my forum and this add-on now does not function).
Thanks in advance!
<?
// Require the library
require ("../main.inc.php");
// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate();
$Username = $user['U_Username'];
$Password = $user['U_Password'];
$html = new html;
if (!$user['U_Username']) {
$html -> not_right ($ubbt_lang['NO_AUTH'],$Cat);
}
// -----------------------------------------
// Get the current information for this username
$Username_q = addslashes($Username);
$db = mysql_connect("localhost", "xxx", "xxx");
mysql_select_db("forum",$db);
$charnames = mysql_query("SELECT *
FROM membership, characters
WHERE mem_name=$Username
AND (char_active = 'Yes')
AND (char_member = mem_name)",$db);
if ($myrow = mysql_fetch_array($charnames)) {
do {
printf("<tr class=content-text><td nowrap>%s </td><td nowrap>%s </td><td nowrap>%s </td><td nowrap>%s</td></tr>\n",
$myrow["char_name"],$myrow["char_rank"],$myrow["char_legion"],$myrow["char_game"]);}
while ($myrow = mysql_fetch_array($charnames));
}
echo "</td></tr></table>";
echo "</center>";
$html -> send_footer();