Couple of things:
Can you edit this line
$result = mysql_query ($sql);
to
$result = mysql_query ($sql) or die( $sql."<br />".mysql_error() );
Run that and then copy/paste the error msg here.
--
I just guessing now, but if you are looking for a distinct county based on state prefix you might want to make a couple changes to your code, fun it and post results here.
for( $i=0; $i<count($_POST['State']); $i++ ) {
if( !isSet( $State1 ) ){
$State1 = "( '{$_POST['State'][$i]}' ";
}else{
$State1 .= ", '{$_POST['State'][$i]}' ";
}//end if
}
$State1 .= " ) ";
$sql = "SELECT DISTINCT z.county, z.state_prefix FROM zip_codes z WHERE z.state_prefix in {$State1} GROUP BY z.count, z.state_prefix";
$result = mysql_query ($sql) or die( $sql."<br />".mysql_error() );
while( $row = mysql_fetch_array( $result, MYSQL_ASSOC() ) {
echo $row['county']." ".$row['state;]."<br />";
}//end while loop
mysql_free_result( $result );
$row = array();
$State1 = $sql = $result = $row = null;
unset( $State1, $sql, $result, $row );
exit('fin');
Let me know how that turns out!
You can also get low cost php support at www.phpsupportnow.com
Good luck