Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

HELP!!!! NEWBIE ALERT!!!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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)
boardmania
New php-forum User
New php-forum User
 
Posts: 5
Joined: Fri Nov 08, 2002 10:08 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Alexa [Bot], Baidu [Spider] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron