select id from [TableName] where username = 'bobo';
解决方案 »
- 帮我跟改个页面样式
- 邮件发送问题?
- PHP构造函数
- 网站和数据库在不同服务器该怎么办
- 请教高人linux 下 通过web端调用pcntl_fork() 方法出错问题
- 使用ob_flush提示:E_WARNING: Cannot modify header information - headers already sent
- PHP怎样读取ASP.NET的COOKIE或者SESSION
- php5.1.1的时间问题
- 函数file_exists判断本地文件不行
- 求教微信接口!!!!!!!!!!!!!!!!!
- 麻烦了,我的php服务器为什么页面之间不能传递变量????急~~
- 我的php不支持imap啊~~(100分相送)
$row=mysql_fetch_array($query);
echo $row["id"];
if(mysql_rows_num($result)>0){//登陆成功
$row=mysql_fetch_array($result);
echo $row["id"];
}
$result=mysql_query($query);
if(mysql_rows_num($result)>0){//登陆成功
$row=mysql_fetch_array($result);
echo $row["id"];
}
$row=mysql_fetch_array($query);
echo $row["id"];
$row=mysql_fetch_object($result);
echo $row->id;
<?
$a=$array[username];
$dbh = mysql_connect('localhost:3306','root','shilyshare520');
mysql_select_db('xinlu',$dbh);
$sql="select username from user where username='".$logname."' and password='".$password."'";
$res = mysql_query($sql, $dbh);
$array=mysql_fetch_array($res);
if($array[username])
{Session_start();
Session_register('a');
$a=$array[username];
?>修改用户信息的页面是user_info.php,代码如下:
<?
if(session_is_registered(a))
{
$sql="select * from user where username='".$username."'";
$dbh = mysql_connect('localhost:3306','root','shilyshare520');
mysql_select_db('xinlu',$dbh);
$res = mysql_query($sql, $dbh);
$row=mysql_fetch_array($res);?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<div align="center">
<p>修改用户信息</p>
<form name="form1" method="post" action="updateuser.php?id=<?print($id);?>">
<p>用户名:
<input name="textarea" type="text" value="<?print($row[username]);?>">
</p>
<p>旧密码:
<input name="textarea2" type="password" value="<?print($row[password]);?>">
</p>
<p>新密码:
<input name="newpass" type="text" id="newpass" value="">
</p>
<p>确认密码:
<input name="newpass2" type="text" id="newpass2" value="">
</p>
<p>
<input type="submit" name="Submit" value="修改">
</p>
</form>
<p> </p>
</div>
</body>
</html><?}
else
{?><html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>你没有这个权限!!!!!!!
</body>
</html>
<?}?>现在的问题是,每次取得的用户id都是1,不知道程序问题出在那里,哪位帮忙看看,而且现在对应用户的信息也不能传回user_info.php这个页面了!
online for waiting.
$sql="select * from user where username=".$a;
<form name="form1" method="post" action="updateuser.php?id=<?print($id);?>">错了 <form name="form1" method="post" action="updateuser.php?id=<?print($row["id"]);?>">
if(session_is_registered(a))错了if(session_is_registered("a"))