$fid = $_SESSION['fid'];
$res = mysql_query("SELECT rf_id, rf_xcoord, rf_ycoord, rf_level, rft_name FROM res_fields rf
inner join res_fields_types rft on rft.rft_id = rf.rft_id
WHERE f.fid = $fid", $link )
or die("Query failed : " . mysql_error());
while ($row = mysql_fetch_array( $res )) {
$rf_x = $row["rf_xcoord"];
$rf_y = $row["rf_ycoord"];
$rf_level = $row["rf_level"];
$rf_id = $row["rf_id"];
$rft_name = $row["rft_name"];
echo '<div style="position:absolute;left:'.$rf_x.'px;top:'.$rf_y.'px;z-index:1" title="'.$rft_name.' Уровень '.$rf_level.'"
onclick="res_details('.$rf_id.')" style="cursor:hand">'.$rf_level.'</div>';
}
Вылазит ошибка:
Query failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and rf_id=' at line 2