ITPUB??ì3
ITPUB论坛 » WEB程序开发 » 请问mysqli是什么东西?

新一届的微软MVP评选已经开始,欢迎各位推荐!

标题: 请问mysqli是什么东西?
离线 itpubkumao
中级会员


来自 上海
精华贴数 0
个人空间 0
技术积分 1960 (823)
社区积分 229 (2284)
注册日期 2007-7-8
论坛徽章:7
      
      

发表于 2008-1-8 14:04 
请问mysqli是什么东西?

我看到有一个mysqli,这是什么东西?与mysql有什么区别?
谢谢!


__________________
能做得更好!
只看该作者    顶部
离线 chenlunpan
Melancholy


精华贴数 3
个人空间 20
技术积分 4785 (281)
社区积分 10116 (154)
注册日期 2006-5-24
论坛徽章:21
2008年新春纪念徽章2008年新春纪念徽章2008年新春纪念徽章2008年新春纪念徽章2008年新春纪念徽章2008年新春纪念徽章
      

发表于 2008-1-8 15:02 
mysql后面的i,指improved, interface, ingenious, incompatible or incomplete(改扩展仍在开发中,因为MYSQL4。1和MYSQL5都没有正式推出尚在开发中,新的特性没有完全实现)
<?php
   
    /* Connect to a MySQL server  连接数据库服务器 */
    $link = mysqli_connect(
                'localhost',  /* The host to connect to 连接MySQL地址 */
                'user',      /* The user to connect as 连接MySQL用户名 */
                'password',  /* The password to use 连接MySQL密码 */
                'world');    /* The default database to query 连接数据库名称*/
   
    if (!$link) {
       printf("Can't connect to MySQL Server. Errorcode: %s ", mysqli_connect_error());
       exit;
    }
   
    /* Send a query to the server 向服务器发送查询请求*/
    if ($result = mysqli_query($link, 'SELECT Name, Population FROM City ORDER BY Population DESC LIMIT 5')) {
   
        print("Very large cities are: ");
   
        /* Fetch the results of the query 返回查询的结果 */
        while( $row = mysqli_fetch_assoc($result) ){
            printf("%s (%s) ", $row['Name'], $row['Population']);
        }
   
        /* Destroy the result set and free the memory used for it 结束查询释放内存 */
        mysqli_free_result($result);
    }
   
    /* Close the connection 关闭连接*/
    mysqli_close($link);
    ?>

[ 本帖最后由 chenlunpan 于 2008-1-8 15:03 编辑 ]


__________________
长期打劫稀有徽章,欢迎接受我的打劫
只看该作者    顶部
离线 itpubkumao
中级会员


来自 上海
精华贴数 0
个人空间 0
技术积分 1960 (823)
社区积分 229 (2284)
注册日期 2007-7-8
论坛徽章:7
      
      

发表于 2008-1-8 15:43 
谢谢版主!

你说的N复杂,我小鸟一个,基本上没明白,看你的代码,像是用的mysqli,但我还是不清楚mysql和mysqli有什么区别。
是它们的使用方法不同?使用的环境不同?还函数的功能不同?
哪个用的比较普遍?

不好意思,实在比较菜,谢谢!

[ 本帖最后由 itpubkumao 于 2008-1-8 15:45 编辑 ]


__________________
能做得更好!
只看该作者    顶部
离线 itpubkumao
中级会员


来自 上海
精华贴数 0
个人空间 0
技术积分 1960 (823)
社区积分 229 (2284)
注册日期 2007-7-8
论坛徽章:7
      
      

发表于 2008-1-8 17:43 
我在看Google了,有问题我再发贴问哈!


__________________
能做得更好!
只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问