here is mine code i modified it for mysql
its mysql function now we can directly check that our long lat is in bounds or not from sql query .
and special thanks to CheeseWarlock and Chris Rae for the solution thanks sir
select inBounds("58.25173","-100.21041","89.71691425364952","180","-88.9294031317244","-180")
and you can call this function in query like this way
DELIMITER $$
CREATE FUNCTION inBounds(pointLat FLOAT, pointLong FLOAT, boundsNElat FLOAT, boundsNElong FLOAT, boundsSWlat FLOAT, boundsSWlong FLOAT) RETURNS VARCHAR(30)
BEGIN
DECLARE westBound FLOAT ;
DECLARE eastBound FLOAT ;
DECLARE inLong FLOAT DEFAULT 0 ;
DECLARE inLat FLOAT DEFAULT 0 ;
IF (pointLong < boundsNElong) THEN
SET eastBound = 1;
End if;
IF (pointLong > boundsSWlong) THEN
SET westBound = 1;
End if;
IF (boundsNElong < boundsSWlong) THEN
IF (eastBound || westBound) THEN
SET inLong = 1;
END if;
ELSE
IF (eastBound && westBound) THEN
SET inLong = 1;
END IF;
END IF;
IF (pointLat > boundsSWlat && pointLat < boundsNElat) THEN
SET inLat = 1;
END IF;
RETURN inLat && inLong;
END$$
DELIMITER ;