学生必须查看自己的详细信息 [英] Student has to view own details

查看:68
本文介绍了学生必须查看自己的详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制一个人看到我在我的数据库中看到的东西给他们只看到他们的信息和产品,以便他们能够更新,编辑和删除他们自己的唯一


Thanx

How do I restrict a person from seeing evrything that I have on my database to them seeing only their information and products for them to be able to UPDATE,EDIT and DELETE their own only

Thanx

推荐答案


如何限制一个人看到我在我的数据库中看到的东西给他们看只有他们的信息和产品能够更新,编辑和删除他们自己的


Thanx
How do I restrict a person from seeing evrything that I have on my database to them seeing only their information and products for them to be able to UPDATE,EDIT and DELETE their own only

Thanx



使用在显示记录的select查询中的条件


例如,如果id为#2的用户登录,请将此id放入会话中,然后qry将为as

Use a where condition in the select query where you display the records

For eg, if the user with the id #2 is logged in , put this id in the session, then the qry will be as


sql = mysql_query(" select * from tableName where id =''"。
sql = mysql_query("select * from tableName where id = ''".


_SESSION [" id"]。"''")或死(mysql_error());


你需要马确保产品表具有foriegn键,这是用户表的主键
_SESSION["id"]."''") or die(mysql_error()) ;

you need to make sure that the product table has the foriegn key which is the primary key of the users table


这篇关于学生必须查看自己的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆