define( 'SAE_MYSQL_HOST_M', 'w.rdc.sae.sina.com.cn' );//主库地址         define( 'SAE_MYSQL_HOST_S', 'r.rdc.sae.sina.com.cn' );//从库地址         define( 'SAE_MYSQL_PORT', 3307 );//数据库端口         define( 'SAE_MYSQL_USER', SAE_ACCESSKEY );//数据库用户名         define( 'SAE_MYSQL_PASS', SAE_SECRETKEY );//数据库密码         define( 'SAE_MYSQL_DB', 'app_' . $_SERVER['HTTP_APPNAME'] );//数据库名
     
    // 连接到数据库
$conn=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
    
     
    // 从表中提取信息的sql语句
     $strsql="select * from userinfo";
     // 执行sql查询
     $result=mysql_db_query(SAE_MYSQL_DB,$strsql, $conn);
     // 获取查询结果
     $row=mysql_fetch_row($result);
     
   
     // 定位到第一条记录
     mysql_data_seek($result, 0);
    //循环取出记录
while ($row=mysql_fetch_row($result))
     {      
         
       for ($i=0,$j=0; $i<mysql_num_fields($result); $i++,$j++ )
    
                   {   
         
   
                  $data[$j%4]=$row[$i];
  

            }
       
  
   $handle = fopen("http://127.0.0.1/hl.php?phone=$data[1]&pwd=$data[2]&to=$data[1]&city=$data[3]", "rb");
     }
     
    
   
     // 释放资源
     mysql_free_result($result);
     // 关闭连接
     mysql_close();  

解决方案 »

  1.   

    然后就出现
    好像还有mysql_db_query不能调用的情况
    SAE_Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sendmsg.php on line 27SAE_Warning: mysql_data_seek() expects parameter 1 to be resource, boolean given in sendmsg.php on line 31SAE_Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sendmsg.php on line 33SAE_Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in sendmsg.php on line 53