用php语言给数据库添加一个用户名和密码的代码怎么写???
1个回答
展开全部
<?php
$tablename = 'abc';
$user = $_POST['user']; //由表单传来
$passwd = $_POST['passwd'];//由表单传来
$passwd = md5($passwd); //change the password to its hash value
$sql = "INSERT INTO TABLE $tablename SET (user=$user ,passwd = $password";
this->db->exec($sql); //应用pear数据库
?>
$tablename = 'abc';
$user = $_POST['user']; //由表单传来
$passwd = $_POST['passwd'];//由表单传来
$passwd = md5($passwd); //change the password to its hash value
$sql = "INSERT INTO TABLE $tablename SET (user=$user ,passwd = $password";
this->db->exec($sql); //应用pear数据库
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |