Emania

Untitled

May 18th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. bool=EXISTS(SELECT * FROM FRIDGE WHERE INGREDIENT='Pasta')
  2. val =(SELECT QUANTITY FROM FRIDGE WHERE INGREDIENT = '$name')
  3. if(val>0){
  4. UPDATE APP.FRIDGE SET QUANTITY=(val+7), WHERE NAME = 'Pasta';
  5. }
  6. else INSERT INTO FRIDGE VALUES($name, $quantity, $date, $place);
Advertisement
Add Comment
Please, Sign In to add comment