Though you *could* use the same "data.php" page to do this, you'd likely find it easier to create another page specifically for the zip codes. Maybe "datazip.php".
Change the query and the fetch line:
Code:
$sql = mysql_query ("SELECT DISTINCT zip FROM cities WHERE zip LIKE '{$query}%'");
...
$array[] = $row['zip'];
Notice that I removed the first % after LIKE. If you don't do that, and the user types "9", then you will find "90105", yes, but you will also find "10019". That is, then "9" can be anywhere in the zip code. By removing that first %, at least the zip code must *START* with what the user typed in. (It's possibly a change you might want to make with your cities query...up to you.)
And then of course create another jQuery function, this one with
Code:
$('[rel=zip]').typeahead({
I don't use jQuery, so I don't know if you need to make other changes there (ask in the jQuery forum), but I don't think so.