赣南脐橙

keybr

佰草伐

导航

PHP mysqli_change_user() 函数

改变指定数据库连接的用户:

<?php 
$con=mysqli_connect("localhost","my_user","my_password","my_db"); 

// 检查连接 
if (mysqli_connect_errno($con)) 
{ 
    echo "连接数据库失败: " . mysqli_connect_error(); 
} 

// 切换数据库 
mysqli_change_user($link, "my_user", "my_password", "my_test"); 

mysqli_close($con); 
?>

  

posted on 2019-07-15 15:35  佰草伐  阅读(105)  评论(0编辑  收藏  举报

keybr

php基础知识

Wood Furniture