无为清净楼资源网 Design By www.qnjia.com
<HTML><BODY BGCOLOR=FFFFFF>  
<?php  
    echo "Connecting as mysql<BR>\n";  
    $connection1 = mysql_connect('localhost', 'mysql', '') or die($php_errormsg);  
    echo "connection1 is $connection1<BR>\n";  
    echo "Selecting test for mysql user<BR>\n";  
    mysql_select_db('test', $connection1) or @die("Error " . $php_errormsg . mysql_error());  
    echo "Connection as joyce<BR>\n";  
    $connection2 = mysql_connect('localhost', 'joyce', '') or die($php_errormsg);  
    echo "connection2 is $connection2<BR>\n";  
    echo "Selecting books for joyce user<BR>\n";  
    $db2 = mysql_select_db('techbizbookguide', $connection2) or die(mysql_error());  
    $query1 = "select foo from test";  
    $query2 = "select title, authorFirst, authorLast from bookinfo";  
    echo "Querying test<BR>\n";  
    $users = mysql_query($query1, $connection1) or die(mysql_error());  
    echo "Querying books<BR>\n";  
    $books = mysql_query($query2, $connection2) or die(mysql_error());  
    echo "Foos from test<BR>\n";  
    while (list($foo) = mysql_fetch_row($users)){  
        echo $foo, "<BR>\n";  
    }  
    echo "Books in techbizbookguide<BR>\n";  
    while (list($title, $authorFirst, $authorLast) = mysql_fetch_row($books)){  
        //Use trim in case we have a book by "Madonna" or "Prince" or...  
        echo $title, ' by ', trim($authorFirst . ' ' . $authorLast), "<BR>\n";  
    }  
?>  
</BODY></HTML>  
标签:
|一个|个连|连接|接两|两个|个不|不同|同M|MY|YS|SQ|QL|L数|数据|据库|库的|的P|PH|HP|P程|程序|序|

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com