"select * from cy where fl=22 && xfl=企业网站"   
 
 我使用这个查询的时候,只要有中文就提示找不到数据源,如果把中文改为数字就可以查了 我觉得奇怪了 这个是什么原因呀?

解决方案 »

  1.   


    "select * from cy where fl=22  and  xfl='企业网站'"
      

  2.   

    select * from cy where fl=22 and xfl like '企业网站%'呢
      

  3.   

    你们两个都不对呀?奇怪啦 
    一楼的我试了好多遍了,2楼也不对 查不出来呀 奇怪啦<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body><table width="100%">
      <tr>
        <td width="28%" height="30">&nbsp;</td>
        <td width="22%">&nbsp;</td>
        <td width="25%">&nbsp;</td>
        <td width="25%">&nbsp;</td>
      </tr><?php 
    include("conn.php");
    echo $_GET[id];
    $rs=mysql_query("select * from cy where fl=22 && xfl=企业网站",$conn);
    while($row=mysql_fetch_array($rs)){
    ?>
      <tr>
        <td height="35"><?php echo $row["name"]; ?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>   
        
    <?php
    }
    ?>
    </table>
    </body>
    </html>
    整个程序就是这样呀 奇怪啦 好像没有错呀
      

  4.   

    只要有中文就提示找不到数据源
    -----------------------
    你这是encode码问题吧。不转码直接用没问题?
      

  5.   

    在数据库执行一下你那个语句,如果能查找的出来的话,就是你encode的问题了,xml里面的中文经常出现乱码情况,需要自己转换格式。