title: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
body: <p>Hell there
  when i try and connect to pull thing out of the database i get the following error:</p>
  
  <pre><code>Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/content/49/5548763/html/matt/download.php on line 17
  </code></pre>
  
  <p>None of the other answers on this site worked.</p>
  
  <p>here is the script:</p>
  
  <pre><code>&lt;?php
  
  $con = mysql_connect("XXXX", "name", "password");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  $db_selected = mysql_select_db("nameofdb",$con);
  
  $musictable = "";
  
  $sql = "GET * FROM matt";
  
  $result = mysql_query($sql,$con);
  
  while($row = mysql_fetch_object($result)) {
  
  $id = $row-&gt;id;
  
  $name = $row-&gt;name;
  
  $update = $row-&gt;update;
  
  $length = $row-&gt;length;
  
  $size = $row-&gt;size;
  
  $musictable .= "
    &lt;tr&gt;
      &lt;td width=\"63%\"&gt;".$name."&lt;/td&gt;
      &lt;td width=\"10%\"&gt;".$length." / ".$size."&lt;/td&gt;
      &lt;td width=\"10%\"&gt;&lt;a href=\"download.php?mp3=".$name."\"&gt;DOWLOAD&lt;/a&gt;&lt;/td&gt;
      &lt;td width=\"17%\"&gt;|||||&lt;/td&gt;
    &lt;/tr&gt;
    ";
  }
  
  ?&gt;
  </code></pre>