title: MySQL Trigger with multiple variables and tables
body: <p>I'm Trying to do something like this to import pricing and stock from my providers.
  Its not working always.</p>
  
  <ul>
  <li>When i do it from my phpMyAdmin works fine, the trigger is launched
  and the data imported fine.</li>
  <li>When i do it from a php script witch charges a CSV into the table products does not work at all.</li>
  </ul>
  
  <p>It was working fine until i added the variables prod_desc and prod_pic from a 3rd table.</p>
  
  <p>Only with the categories was working fine.</p>
  
  <p>Any suggestion?</p>
  
  <pre><code>CREATE TRIGGER triggername BEFORE INSERT ON products FOR EACH ROW BEGIN 
  DECLARE name_cat VARCHAR( 255 ) ;
  DECLARE prod_desc TEXT ;
  DECLARE prod_pict  VARCHAR( 255 ) ;
  
  SELECT category_name
  INTO name_cat
  FROM products_categories
  WHERE cat_id = NEW.products_cat_id;
  
  SELECT products_description, products_picture
  INTO prod_desc, prod_pic
  FROM products_description
  WHERE products_id = NEW.products_id;
  
  SET NEW.categories_name = name_cat, NEW.products_picture=prod_pic, NEW.products_description = prod_desc, NEW.Products_id=CONCAT('DEP',NEW.Products);
  
  END
  </code></pre>