[SOLVED] Help Needed on mysgl_fetch_array
Posted: Wed Jul 28, 2004 4:55 am
Hello.
So i needed to switch hosts, so I did. Upon upload of the files to the new site, only one PHP script does not work. I must have all db connect info right, db name and everything, but when i view the page I get the following:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/omninite.com/subdomains/lw/httpdocs/site/index.php on line 538
here is my script, whats up? I did not change anything, just dled from old host and uploaded to new host. P.S. mysql_connect info taken out for secuity reasons
P.S.S. Line # 538 is
So i needed to switch hosts, so I did. Upon upload of the files to the new site, only one PHP script does not work. I must have all db connect info right, db name and everything, but when i view the page I get the following:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/omninite.com/subdomains/lw/httpdocs/site/index.php on line 538
here is my script, whats up? I did not change anything, just dled from old host and uploaded to new host. P.S. mysql_connect info taken out for secuity reasons
P.S.S. Line # 538 is
Code: Select all
while ($row = mysql_fetch_array($top_poster_sql))Code: Select all
<?php
mysql_connect("localhost", "computer_LWForum", "DFF20466") or
die("Could not connect: " . mysql_error());
$db_name = "computer_LWForum"; // The name of the database where your forums are installed
mysql_select_db($db_name);
// Variables
$ibf_members = "ibf_members"; // The name of your members table
$ibf_member_extra = "ibf_member_extra";
$ibf_groups = "ibf_groups";
$top_poster_sql = mysql_query("SELECT name, posts
FROM $ibf_members m
LEFT JOIN $ibf_member_extra me ON me.id=m.id
LEFT JOIN $ibf_groups g ON m.mgroup=g.g_id
WHERE m.id > 0 AND g.g_hide_from_list <> 1
ORDER BY posts desc LIMIT 0, 5");
echo "<table cellpadding='4' cellspacing='1' border='0' width='100%' height="145" style="color: #093349; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 10px" id="table52">";
echo "<tr style="color: #093349; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 10px">";
echo "<td colspan='2' class='maintitle' background='tile_sub.gif' height="12">";
echo "<p align="left"><b>.::Top Five PosterZ::.</b></td>";
echo "</tr>";
echo "<tr style="color: #093349; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 10px">";
echo "<td class='row1' valign='middle' align='left' width='35%' height="10"><b>Username</b></td>";
echo "<td class='row1' valign='middle' align='left' width='65%' height="10">";
echo "<p align="center">";
echo "<b>Posts</b></td>";
echo "</tr>";
echo "<tbody>";
while ($row = mysql_fetch_array($top_poster_sql))
{
$NAME = $row["name"];
$POSTS = $row["posts"];
echo "<tr style="color: #093349; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 10px">";
echo "<td class='row4' width='80%' height="12" align="left">$NAME</td>";
echo "<td class='row4' width='20%' align='right' height="12">$POSTS</td>";
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>