我在数据库中显示如何设置样式的复选框 [英] I displaying checkboxes from database how to style it
问题描述
这是我显示复选框的功能
function builcheckBrand($ children){
$ list ='';
$ sql =SELECT distinct br.brand_id,br.brand_name,tp.pd_brand_id FROM ak_krt_pd_brand br JOIN ak_krt_tbl_product tp on tp.pd_brand_id = br.brand_id where cat_id IN $ children;
$ result = dbQuery($ sql)或die('无法获得产品。'。mysql_error());
$ results = dbNumRows($ result);
$ count = count($ results);
if($ results!= 0)
{
while($ nt = mysql_fetch_array($ result) ))
{
echo< input type ='checkbox'align ='top'name ='checkbox []'value ='$ nt [brand_id]' > $ nt [brand_name]
;
}
}其他{}
}
This is my function to display checkboxes
function builcheckBrand($children){
$list = '';
$sql = "SELECT distinct br.brand_id,br.brand_name,tp.pd_brand_id FROM ak_krt_pd_brand br JOIN ak_krt_tbl_product tp on tp.pd_brand_id=br.brand_id where cat_id IN $children";
$result = dbQuery($sql) or die('Cannot get Product. ' . mysql_error());
$results = dbNumRows($result);
$count=count($results);
if($results != 0)
{
while($nt=mysql_fetch_array($result))
{
echo "<input type='checkbox' align='top' name='checkbox[]' value='$nt[brand_id]'>$nt[brand_name]
";
}
}else{}
}
推荐答案
孩子们){
children){
list ='';
list = '';
sql =SELECT distinct br.brand_id,br.brand_name,tp.pd_brand_id FROM ak_k rt_pd_brand br在tp.pd_brand_id = br.brand_id上加入ak_krt_tbl_product tp,其中cat_id IN
sql = "SELECT distinct br.brand_id,br.brand_name,tp.pd_brand_id FROM ak_krt_pd_brand br JOIN ak_krt_tbl_product tp on tp.pd_brand_id=br.brand_id where cat_id IN
这篇关于我在数据库中显示如何设置样式的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!