I'm working on a little application for competition sailors, but i have a problem. I need the data from the 2 rows above and 2 rows beneath the row from the specific sailor. My database looks like this:
And this is the SQL i use to get the data above and beneath:
$data_above= mysql_query("SELECT * FROM Laser_Radiaal WHERE points < (SELECT points FROM Laser_Radiaal WHERE PLACE = ID) ORDER BY PLACE DESC LIMIT 2");
$data_under= mysql_query("SELECT * FROM Laser_Radiaal WHERE points < (SELECT points FROM Laser_Radiaal WHERE PLACE = ID) ORDER BY points ASC LIMIT 2");
But it don't work, what do i wrong?
Thanks!
EDIT: I get the following error:
Warning: mysql_fetch_array() expects parameter 1 to be resource