I'm doing a geo search with mysql using the spatial extension. FOr that i did a stored procedure (thats work really well when i tri on command line in mysql like that
mysql> CALL test2(GeomFromText('POINT(-0.93961472 43.52843475)'),0.6 );
DROP PROCEDURE `test2`//
CREATE DEFINER=`root`@`localhost` PROCEDURE `test2`(IN center2 point,IN dist int)
BEGIN
SET @center = center2;
SET @radius = dist;
SET @bbox = CONCAT('POLYGON((',
X(@center) - @radius, ' ', Y(@center) - @radius, ',',
X(@center) + @radius, ' ', Y(@center) - @radius, ',',
X(@center) + @radius, ' ', Y(@center) + @radius, ',',
X(@center) - @radius, ' ', Y(@center) + @radius, ',',
X(@center) - @radius, ' ', Y(@center) - @radius, '))'
);
SELECT professionnels.*, AsText(coord)
FROM professionnels
WHERE Intersects( coord, GeomFromText(@bbox) )
AND SQRT(POW( ABS( X(coord) - X(@center)), 2) + POW( ABS(Y(coord) - Y(@center)), 2 )) < @radius limit 20;
end
But the problem is that i need to call that from php. and when i do it, an error is return said that
PROCEDURE test2 can't return a result set in the given context
So.. How can i use a turn around to return a set of data ?
Thanks