Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'jIHAO_74999113F' (11001) in E:\workspace\Addressbook\index.php on line 18连接出现该错误,用root,root,也连不上啊
着是连接的代码: $page_size=10;   //每页记录数
    if($page<=0)$page=1;   //获取当前的页码
    
    $mylink=mysql_connect("jIHAO_74999113F","root","root");
    mysql_select_db("personal",$mylink);
    $sql="select * from address order by name";
    $result=mysql_query($sql);
    $hangshu=mysql_num_rows($result);//从结果中获取行数
    $pages=ceil($hangshu/$page_size); //获取多少页用的是xampp集成开发

解决方案 »

  1.   

    主机名有问题 再确认一下 本地的话localhost 
      

  2.   

    在本机的话就 localhost 要不就127.0.0.1
      

  3.   

    $mylink=mysql_connect("localhost","root","root");
      

  4.   

    楼上正解:
    $mylink=mysql_connect("localhost","root","root");
      

  5.   

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
    还是报错
      

  6.   

    $page_size=10;   //每页记录数
        if($page<=0)$page=1;   //获取当前的页码
        
        $mylink=mysql_connect("localhost","root","");
        echo $mylink."连接:<br>";
        mysql_select_db("personal",$mylink);
        $sql="select * from address";
        $result=mysql_query($sql,$mylink);
        echo $result."结果";
        $hangshu=mysql_num_rows($result);//从结果中获取行数
    红线出报异常:
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result。
      

  7.   

    sql语句写错了.$result=mysql_query($sql,$mylink) or die(mysql_error());
      

  8.   

    mysql 存储过程错误delimiter $$ CREATE PROCEDURE proc_chaxun( IN num int, IN id int, IN uid int, IN content varchar( 100 ) ) BEGIN declare@errornum int BEGIN Transaction SET declare =0 INSERT INTO lyb.replace(zid,
    uid,
    rcontent
    )
    VALUES (
    @id , @uid , @content 
    )
    SET @errornum = @errornum + @ @error UPDATE zhuti SET z_rnum = @num WHERE zid = @id SET @errornum = @errornum + @ @error IF @errornum <>0 BEGIN print '事务失败' ROLLBACK Transaction END ELSE BEGIN print '事务成功' COMMIT Transaction END gocall proc_chaxun( 3, 10, 5, '我们在这里啊' ) MySQL 返回: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter $$
    create procedure proc_chaxun(in num int,in id int,in uid int,in co' at line 1