Copy CodeThe code is as follows:
<title>Insert a new piece of data</title>
Copy CodeThe code is as follows:
@mysql_connect ("localhost", "root", "1981427")//Select the database before you need to connect to the database server
Or Die ("Database server Connection Failed");
@mysql_select_db ("test")//Select Database MyDB
Or Die ("database does not exist or is not available");
$id = $_post[' id '];
$username = $_post[' username ');
$password = $_post[' password ');
$query = mysql_query ("INSERT into tablename1 values ($id, ' $username ', ' $password ')");
if ($query)
echo "Data insertion success";
Else
echo "Data insertion failed";
Mysql_close ();
?>
http://www.bkjia.com/PHPjc/319931.html www.bkjia.com true http://www.bkjia.com/PHPjc/319931.html techarticle Copy the code as follows: HTML head title inserts a new data/title meta http-equiv= "Content-type" content= "text/html; charset=gb2312"/head Body Form method= "POST" Name= "Form1" ...