$sql = "selcet renq from vtiger_account where phone='".$var["tel"]."' or otherphone='".$var["tel"]."'"; 
print_r($sql);
exit;
打印语句后直接查询看看,这样的问题多去测试下

解决方案 »

  1.   

    selcet renq from vtiger_account where phone='12345678' or otherphone='12345678'
      

  2.   

    那单独测试可以查到数据吗?再说你只有renq字段
    怎么$row['accountname']这样?
      

  3.   


    renq字段???renq库名称VTIEGER_ACCOUNT是表名PHONE是查找的字段ACCOUNTNAME 是要输出的客户名称
      

  4.   

    什么乱七八糟的
    selcet renq from vtiger_account where phone='12345678' or otherphone='12345678'
    这是个什么?
    原来才知道你语句就是个错误
    mysql_select_db("renq")库用在这里
    selcet accountname from vtiger_account where phone='12345678' or otherphone='12345678'
    输出字段用在这里
      

  5.   

    $sql = "selcet accountname from vtiger_account where phone='61152500' or otherphone='61152500'";
    $result=mysql_query($sql,$conn);
    if(mysql_num_rows($result)>0)
    {
      while($row = mysql_fetch_array($result))
       {
           echo $row['accountname']."<br>";
       }
     }
      

  6.   

    $sql = "selcet accountname from vtiger_account where phone='61152500' or otherphone='61152500'"; 
    提示什么?
      

  7.   

     The page cannot be displayed 
    The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings. --------------------------------------------------------------------------------Please try the following:Click the  Refresh 
      

  8.   

    这和你数据库等操作没什么,是你站点的错误?
    你页面不添加语句能够浏览?
    比如说页面只写一个echo "aaa"
      

  9.   

    <?
    echo "111";
    ?>可以啊 输出111
      

  10.   

    然后一句一句添加
    $conn=mysql_connect("localhost","root","renq") or die("指定的数据源、用户名或者密码错误请检查后重新登陆");;
      mysql_select_db("renq") or die("选择数据库出错,可能是您指定的数据库不存在!");; 
    看看,到哪一部出现错误
      

  11.   

    if(mysql_num_rows($result)>0)//21行
    {
      while($row = mysql_fetch_array($result))
      {
           echo $row['accountname']."<br>";
       }
     }Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\ceshi.php on line 21
    到这里出错
      

  12.   

    <?php$link = mysql_connect("localhost", "mysql_user", "mysql_password");
    mysql_select_db("database", $link);$result = mysql_query("SELECT * FROM table1", $link);
    $num_rows = mysql_num_rows($result);echo "$num_rows Rows\n";?> 
    这是手册的例子,你按照它的来,
    语句就是
    $sql = "selcet accountname from vtiger_account where phone='61152500' or otherphone='61152500'"; 
    自己测试看吧,因为我都不知道你之前都怎么写的,上面的错误是你的$result不是有效的
      

  13.   

    谁会增加新模块啊???
    我创建了一个模块,导进去后出现错误,
    in E:\www\Purchaes\include\database\PearDatabase.php:789 Stack trace: #0 E:\www\Purchaes\modules\Notice\ListView.php(152): PearDatabase->query_result(false, 0, 'count') #1 E:\www\Purchaes\modules\Notice\index.php(13): include_once('E:\www\Purchaes...') #2 E:\www\Purchaes\index.php(711): include('E:\www\Purchaes...') #3 {main} thrown in E:\www\Purchaes\include\database\PearDatabase.php on line 789
    大家帮忙看看吧。