Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DEFINER=`root`@`localhost` PROCEDURE `spCityIPData`(IN InputIP VARCHAR(100), IN InputCityID INT)
- BEGIN
- declare DateAdd date;
- if InputCityID is null then
- select CityID
- from tblCityIPData
- where IP LIKE InputIP
- and DATE(DateAdd) > DATE(DATE_SUB(NOW(), INTERVAL 15 DAY));
- else
- delete from tblCityIPData where IP LIKE InputIP;
- insert into tblCityIPData (IP, DateAdd, CityID)
- values (InputIP, DATE(NOW()), InputCityID);
- end if;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement