title: Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/795746/warning-mysql-fetch-array-supplied-argument-is-not-a-valid-mysql-result">Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result</a>  </p>
  </blockquote>
  
  
  
  <pre><code>        $err = mysql_query("INSERT INTO tridy (id,NazevTridy,url) VALUES (
              '$i',
              '$tridy-&gt;find('div[class=rozvrhseznam]', 0)-&gt;find('a[href]', $i)-&gt;outertext',
              '$tridy-&gt;find('div[class=rozvrhseznam]', 0)-&gt;find('a[href]', $i)-&gt;href')");
          mysql_error($err); // line 97
  </code></pre>
  
  <blockquote>
    <p>Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /hosting/www/cran-web.com/www/rozvrh/engine.php on line 97</p>
  </blockquote>
  
  <p>--- lines 2-6:</p>
  
  <pre><code>$username="*****.com";
  $password="*********";
  $database="*********";
  mysql_connect('127.0.0.1', $username, $password) or die('Could not connect'.mysql_error());
  mysql_select_db($database) or die( "Cannot select db.");
  </code></pre>
  
  <p>I'm getting this error when I try to execute my query. Can you tell what does the error message mean and how to fix it?</p>