HELP!!!! NEWBIE ALERT!!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

boardmania
New php-forum User
New php-forum User
Posts: 5
Joined: Fri Nov 08, 2002 10:08 pm

HELP!!!! NEWBIE ALERT!!!

Postby boardmania » Fri Nov 08, 2002 10:13 pm

:x

For some reason I'm gettin this error when opening the webpage "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/viewdb.php on line 8"

Here's my php code:

<HTML>
<?php
$db = mysql_connect("localhost", "xxx", "xxxx");
mysql_select_db("learndb",$db);
$result = mysql_query("SELECT * FROM personnel",$db);
echo "<TABLE>";
echo "<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>";
while($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "<TD>";
echo $myrow["nick"];
echo "<TD>";
echo $myrow["salary"];
}
echo "</TABLE>";
?>
</HTML>

Anyone have any ideas?????????

boardmania
New php-forum User
New php-forum User
Posts: 5
Joined: Fri Nov 08, 2002 10:08 pm

Postby boardmania » Fri Nov 08, 2002 10:33 pm

NO need for help now as I found out the issue....... my host puts varibles in front of my database names thus altering ( WTH)


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest