...and I've customized it (slightly) to pull information from my mysql database.
Everything is working fine, however, my problem is that when the user selects a specific location from the drop down, its passing over the suburb, the state, and the postcode. I only want to pass over the postcode value, so I can handle the results easily on the search results page.
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) ) { $data[] = array( 'label' => $row['pcode_area'] .', '. $row['pcode_state'] .' '. $row['pcode_postcode'] , 'value' => $row['pcode_area'] .', '. $row['pcode_state'] .' '. $row['pcode_postcode'] .'; ' );
It posts this to my search results page...
I only want the postcode value.
So instead, I would like ...
Array ( [zipsearch] => 4000; )
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) ) { $data[] = array( 'label' => $row['pcode_area'] .', '. $row['pcode_state'] .' '. $row['pcode_postcode'] , 'value' => $row['pcode_postcode'] .'; ' );
..which passes over just the postcode like I want, but that's no good because upon selection, the suburb and state disappear leaving just the postcode in the selection box, which may confuse people.
I'm pretty sure there's an easy way to do this, but being new to PHP, I'm a bit lost.
I would really appreciate some help with this, as I'd like to get this sorted ASAP.
Thank you.
John