title: Fatal error: Call to undefined method
body: <p>Im learning how to use classes in php</p>
  
  <p>Im trying to insert information on my database, but its giving me this error</p>
  
  <p>Fatal error: Call to undefined method Produto::introduzirProduto() in C:\xampp\htdocs\kapa\classes\lol.php on line 7</p>
  
  <p>Connection code:</p>
  
  <pre><code>&lt;?php
  
  class dbConnect{
  private $db_host;
              private $db_user;  
              private $db_pass;  
              private $emp_db = "mydb";
  
              var $connection;
              var $db_select;
              var $result;
              var $row;
  
              function __construct(){
                  $this-&gt;db_host = "localhost";
                  $this-&gt;db_user = "root";
                  $this-&gt;db_pass = "";
              }
  
              function connect(){
                  $this-&gt;connection = mysql_connect($this-&gt;db_host, $this-&gt;db_user, $this-&gt;db_pass);   //create connection
                      checkErr($this-&gt;$connection);
  
                  $this-&gt;db_select = mysql_select_db($this-&gt;emp_db, $connection);
                      checkErr($this-&gt;db_select);
              }
  }
  
  ?&gt;
  </code></pre>
  
  <p>Form:</p>
  
  <pre><code>&lt;?php
  require_once 'introduzir.class.php';
  ?&gt;
  &lt;form action="lol.php" method="POST" id=""&gt;
    &lt;input type="text" name="id"/&gt;
    &lt;input type="submit" value="ok.." /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Insert code</p>
  
  <pre><code>&lt;?php 
    require_once('conectar.php');
  
    class Produto  extends dbConnect {
          var $bd;
    }
  
       function Produto() {
          global $emp_db, $db_user, $db_pass, $db_host;
                  $this-&gt;bd = new dbConnect();
                  $this-&gt;bd-&gt;ligarBD($emp_db, $db_user, $db_pass, $db_host);
          }
  
          function introduzirProduto($id) {
              $sql = "INSERT INTO produto VALUES ('$id')";
              if($this-&gt;bd-&gt;executarSQL($sql)) return true;
              else return false;
          }
  
  
  ?&gt;
  
  &lt;?php
  require_once 'introduzir.class.php';
  
  if($_REQUEST['id']!="") {
  
                              $produto = new Produto();
                              if($produto-&gt;introduzirProduto($_REQUEST['id'])) {
  
                                  echo "Registo efectuado com sucesso !!!&lt;br&gt;";
                              } else {
                                  echo "Problema encontado no Registo !!!&lt;br&gt;";
                              }
  
  
              } else {
                  echo "ERRO: Deve introduzir a sua password...&lt;br&gt;";
              }
  
  ?&gt;
  </code></pre>
  
  <p>what do i need to change?</p>