<?php session_start(); include("conn/conn.php");?>
<?php
//Pick out information from database and print out.
$type = $_GET['type'];
$q_word="select id ,attr_type,pic_url,pic_desc from projectinfo where attr_type='".$type."' order by attr_type";
$res=mysql_query($q_word);
if ($res){
while($row=mysql_fetch_array($res)){
// echo $site.'/'.$upload_dir.'/'.$p_name.'/'.$row[attr_type].'/'.$row[pic_url];
$json=json_encode($row);
echo $json;
}
}else{
echo "无记录!";
}
?>
PHP 从数据库遍历返回json
最新推荐文章于 2021-03-18 08:55:54 发布