Guest User

Untitled

a guest
Jan 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. date_default_timezone_set('America/Tijuana');
  2. $year = date("y");
  3.  
  4. $query = 'INSERT INTO inventory_list (folio,description_item,price_item,manufacturer,model_item,reorder_Level,target_Stock,image,registerDate,commentt,fkEngineer,fkCategory,fkLocation,fkSupplier,fkUnit,fkSubCat)
  5. VALUES (?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
  6.  
  7.  
  8. $result = $connection->executeNonQuery($query,array($year,$_POST['description_item'], $_POST['price_item'] ,
  9. $_POST['manufacturer'], $_POST['model_item'], $_POST['reorder_Level'], $_POST['target_Stock'], $_POST['imageName'],
  10. $hoy, $_POST['commentt'] ,$_POST['fkEngineer'],$_POST['fkCategory'],$_POST['fkLocation'],$_POST['fkSupplier'],$_POST['fkUnit'],$_POST['fkSubCat']));
  11.  
  12. CREATE DEFINER=`root`@`%` PROCEDURE `Agregar_inventory_list`(
  13. in xfolio text,
  14. in xdescription_item text
  15. )
  16. BEGIN
  17. declare v_id int(11);
  18. insert into inventory_list(folio,description_item,anio) values(xfolio,xdescription_item,year(now()));
  19. select max(id) into v_id from inventory_list;
  20. update inventory_list set concatenado=concat(v_id,'-',year(now())) where id=v_id;
  21. END
Add Comment
Please, Sign In to add comment