Seems like you're going through a lot of trouble. With PHP, it's just a matter of checking if "select all" was chosen or not. If it was, add the options to the SQL query. If not, you don't want those options in the SQL query, so it will select all of them.
So say your form looked something like this...
<form name="blah" method="post" action="somepage.php">
<b>Select ALL</b>: <input type="checkbox" name="select_all" value="1" />
<br />
<select name="options[]" multiple>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
<option value="d">D</option>
</select>
<br />
<input type="submit" name="submitButton" />
</form>
You give a checkbox for the "Select All" option, then on the next page, see if it was chosen...
// build sql query
$sql = "SELECT field1, field2
FROM table
WHERE 1=1";
if(!isset($_POST['select_all']) || $_POST['select_all'] != 1) {
// they didn't want all, so we need to add the field
$sql .= " AND field IN ('".implode("','",$_POST['options'])."')";
}
// otherwise they hit "select all", and we can disregard
// the field, and don't need to add it to the query
$res = mysql_query($sql);
// and so on