Check out the function fred(…) in the following topic:
Add the function to your script then test the following:
$_GET $sql $to_rack $row2
I hope you temporarily set error_reporting and display_errors on