有两长表
t_articles(存文章用的)
t_articletype(存文章类型用的)
以下是表的SQL语句:create table t_articles(id integer primary key not null,artid integer(10) not null,arttitle varchar(100),artcolor varchar(30),arttype integer(10) not null,artcontent text,writetime datetime(8),arttags varchar(100));create table t_articletype(id integer primary key not null,typeid integer(10) not null,typename varchar(100));两张表我通过t_articles.arttype 与t_articletype.typeid 关联的现在用php读取数据<?php
require("connection.php");
require("../include/function.php");
$conn = SqliteDbConn();
$sql = "select t_articles.*,t_articletype.typename from t_articles,t_articletype where t_articles.arttype = t_articletype.typeid order by t_articles.id desc";
$query = sqlite_query($sql,$conn);
if($query)
{
$str = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><document>\n";
while($rs = sqlite_fetch_array($query))
{ $str.="<arts><id>".$rs["id"]."</id><arttitle>".$rs["arttitle"]."</arttitle><arttype>".$rs["arttype"]."</arttype><artcontent><![CDATA[".$rs["artcontent"]."]]></artcontent><writetime>".$rs["writetime"]."</writetime><arttags>".$rs["arttags"]."</arttags></arts>";
}
$str.="</document>";
}
DbClose();
echo iconv("gb2312","utf-8",$str);
?>XML是输出来了,可是里面的数据全部为空的
能帮我解决一下这个问题吗?小弟刚学PHP的,查了半天资料也没查出什么原因的