<?php
$host?=?'127.0.0.1';
$user?=?'root';
$pass?=?'root';
$database_name?='test2';
if?(mysql_connect($host,$user,$pass))
????echo?"打開(kāi)成功<br>";
else?
????echo?"打開(kāi)失敗<br>";
mysql_select_db($database_name);
mysql_query("set?name?utf8");
//?mysql_query('set?names?utf8');
$mobi?=?'13800138000';
$na="測(cè)試";
$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?"你的手機(jī)號(hào)是".$jie[1]."???你的密碼是".$jie[3]."??????你的id是".$jie[0].'<br>';
問(wèn)下為什數(shù)據(jù)寫(xiě)入數(shù)據(jù)庫(kù)總是空白 代碼有問(wèn)題嗎?[na寫(xiě)入空白]
qq_十指緊扣韓_0
2015-10-31 12:34:04