我从一个网站获得了这段代码,我正在尝试根据我的测试脚本来定制它。我想显示 company_name 而不是 zip、city、state。我该如何修改这个?
PHP:
$rs = mysql_query('select company_name from names_of_companies where
company_name like "'. mysql_real_escape_string($_REQUEST['term']) .'%"
order by company_name asc limit 0,10', $dblink);
$data = array();
if ( $rs && mysql_num_rows($rs) )
{
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
{
//This is the part where instead of displaying zip, city, state
I only want company_name, how can i do that?
$data[] = array(
'label' => $row['zip'] .', '. $row['city'] .' '. $row['state'] ,
'value' => $row['zip']
);
}
}