<?php
$host = '127.0.0.1';
$user = 'root';
$pass = 'root';
$database_name ='test2';
if (mysql_connect($host,$user,$pass))
echo "打开成功<br>";
else
echo "打开失败<br>";
mysql_select_db($database_name);
mysql_query("set name utf8");
// mysql_query('set names utf8');
$mobi = '13800138000';
$na="测试";
$pa='123456';
$sql="insert into adminuser(mobile,name,password)values('$mobi','$na','$pa')";
if (mysql_query($sql))
echo "插入成功";
else
echo "插入失败";
$u= mysql_insert_id();
echo mysql_error();
echo $u;
$ji=mysql_query('select*from adminuser');
while ($jie=mysql_fetch_row($ji))
echo "你的手机号是".$jie[1]." 你的密码是".$jie[3]." 你的id是".$jie[0].'<br>';
- 2 回答
- 0 关注
- 2046 浏览
添加回答
举报
0/150
提交
取消