The title is a bit confusing I guess but this is what I need:
I have a jquery autocomplete textfield and it gets its data from a database. Everything works, I can type a part of a zipcode in the textfield and when that part exists in the database it shows all available options together with the city, state etc.
But what I want is to show the flag of the country (as an image) in the list of options. I made a new row: county (which contains the url to an image file of the flag)
And this is where it goes wrong:
$rs = mysql_query('select zip, city, county, state from zipcode where zip like "'. mysql_real_escape_string($_REQUEST['term']) .'%" order by zip asc limit 0,10', $dblink);
$data = array();
if ( $rs && mysql_num_rows($rs) )
{
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
{
$data[] = array(
'label' => $row['zip'] .', '. $row['city'] .' '. $row['state'] .' '. <img src='http://www.colinch.com/fut/$row['county'].'' /> ,
'value' => $row['zip']
);
}
}
I'm not a php expert so I think it's just a simple thing that went wrong. When I remove the < img src="......." part it will just print the $row['county'] which looks like this: USA.png
I hope someone can help me!
Thanks in advance