怎么在HTML中获取PHP中某个变量的值

怎么在HTML中获取PHP中某个变量的值,第1张

获取变量的值?应该在html页面展示从数据库中取出来的值吧

如果是取出来的,在html页面,连接数据库查询,然后通过while循环把数据库的循环出来

<php echo $res['字段'];> 这样就把数据表的值输出出来了!

class Search_goods {

//获取商品列表

public function search_goods_list($bn,$price,$cost,$weight,$name,$cat_name,$store,$unit,$brand){

$sql="select abn,aprice,acost,aweight,aname,bcat_name,astore,aunit,abrand from sdb_goods a,sdb_goods_cat b where acat_id=bcat_id";

$res=mysql_query($sql);

$g_res=mysql_fetch_array($res);

while($g_res){

$g_res['bn']=$this->search_goods_list($bn);

$g_res['price']=$this->search_goods_list($price);

$g_res['cost']=$this->search_goods_list($cost);

$g_res['weight']=$this->search_goods_list($weight);

$g_res['name']=$this->search_goods_list($name);

$g_res['cat_name']=$this->search_goods_list($store);

$g_res['store']=$this->search_goods_list($store);

$g_res['unit']=$this->search_goods_list($unit);

$g_res['brand']=$this->search_goods_list($brand);

//你直接输出下看看呗

var_dump($g_res);

}

}

}

以上就是关于怎么在HTML中获取PHP中某个变量的值全部的内容,包括:怎么在HTML中获取PHP中某个变量的值、php 获取类方法里面的内容怎么查看变量是否获得内容、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9642948.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-30
下一篇2023-04-30

发表评论

登录后才能评论

评论列表(0条)

    保存