error is : mysql_fetch_array() expects parameter 1 to be resource, boolean given in line 28

<?   $result = mysql_query("SELECT * FROM chart1");
      while ($row = mysql_fetch_array($result))
      {
         echo $row['price'];
         }
         ?>

There was an error, did you connect properly?

$result = mysql_query("SELECT * FROM chart1") or die(mysql_error());
$result = mysql_query("SELECT * FROM chart1") or die(mysql_error());

not working

I know. What error do you see?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.