欢迎来到思维库

思维库

PHP连接MySQL数据库的代码描述

时间:2025-11-05 02:52:59 出处:IT科技类资讯阅读(143)

PHP连接MySQL数据库的代码描述
复制<?数据php $link=MySQL_connect("localhost","root","123")   or die("connect to database failed");   $result=MySQL_query("create database trampt")   or die("query failed");   MySQL_select_db("trampt");   MySQL_query("set names UTF8");   $result=MySQL_query("create table Users(userid int auto_increment primary key,username varchar(50),password varchar(50))")   or die("query failed");   MySQL_query("insert into users(username,password) values(博客园,123)")   or die("insert record failed");   MySQL_close($link);   ?> 1.2.3.4.5.6.7.8.9.10.11.12.13.

分享到:

温馨提示:以上内容和图片整理于网络,仅供参考,希望对您有帮助!如有侵权行为请联系删除!

友情链接: