Jump to content


This topic is now archived and is closed to further replies.


Cant recive database query!?

Recommended Posts

When i try to recive data from my database i get the following error message (on the webpage):

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /customers/vahlne.se/vahlne.se/httpd.www/index.php on line 18

My code in PHP looks as follows (from row 13(<?php)-24(?>)):

$result = mysql_query("SELECT * FROM maraton1 ORDER BY Plats ASC",$db);
echo "<table border=1 align=center cellspacing=2 cellpadding=3>\n";
echo "<TR><TH>Plats<TH>Lag<TH>Poäng</TR>\n";
while ($rad = mysql_fetch_array($result))
echo "<TR><TD>$rad[Plats]<TD>$rad[Lag]<TD>$rad[Poäng]\n";

echo "</TABLE>";

Would be greatful for all help!!

Thanks alot,


Share this post

Link to post
Share on other sites
Hello Tokkille,

most likely you will have an error in your sql.
please run the query like this
mysql_query($Query) or die(mysql_error());

this will get your the error and this error will help you.


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.