I get this error in my PHP script (which is included as a file within a main PHP file):
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\www\vhosts\myradiostation.co.uk\showfile.php on line 13
This is the full code of the script (line 13 is highlighted in bold text):
Quote:
<?php
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","PASSWORDREMOVED");
//select which database you want to edit
mysql_select_db("myradio");
//select the table
$result = mysql_query("select * from presenters");
//grab all the content
while($r=mysql_fetch_array($result))
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
{
$shows=$r["shows"];
$onair=$r["onair];
$images=$r["image"];
$showdesc=$r["showdesc"];
echo "<div class=\"divider\"></div>
<div class=\"main\" style=\"width:552px;\">
<img src=\"$images\" width=115 height=60>
<div class=\"time\">$onair</div>
<div class=\"show\"><h3><b>$shows</b></h3>
<p>$showdesc</p></div>
<div class=\"footer\"></div>
</div>";
}
?>
How do I fix this error myself - I have tried to look it up on Google and fix it myself, but so far I haven't had much luck!
I'm running Apache on localhost, if that's of any interest, with PHP 5.25.