title: PHP & SQL: Function to insert and update tables not working
body: <p>I have a simple code where tables are created and modified, but the tables are not created to start with, and the following errors are appearing:</p>
  
  <blockquote>
    <p>Undefined variable: price on line 28<br>
        Undefined variable: newbrand on line 28<br>
        Undefined variable: newprice on line 28</p>
  </blockquote>
  
  <p>Line 28:</p>
  
  <pre><code>$conexion-&gt; modify("Mitsubishi",40000000,$price,$newbrand,$newprice);
  </code></pre>
  
  <p>Complete code:</p>
  
  <pre><code>&lt;?php
  
  class MyDataBase{
      private $link;
  
      public function __construct($server,$user,$password,$base){
          //Conectar
          $this-&gt;link = mysql_connect($server,$user,$password);
          mysql_select_db($base,$this-&gt;link);
          }
  
          public function insert($model,$brand,$price){
              mysql_query("INSERT INTO autos (model, brand, price) VALUES ($model,'$brand', $price)",$this-&gt;link);}
  
          public function modify($model,$brand,$price,$newbrand,$newprice){
              mysql_query("UPDATE 'crautos'.'autos' SET 'brand' = '$newbrand',
                          'price' = '$newprice' WHERE 'autos'.'model' =5 AND 'autos'.'brand' = '$brand' AND 'autos'.'price' ='$price' LIMIT 1" ,$this-&gt;link);}
  
          public function __destruct(){
          //desconectar
          }
  
  }
  
  
  $conexion = new MyDataBase ('localhost', 'root', '','crcars');
  $conexion-&gt; insert(05,"Ford",50000000);
  $conexion-&gt; modify("Mitsubishi",40000000,$price,$newbrand,$newprice);
  ?&gt;
  </code></pre>