473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

allow users to update their own info in a MySQL db

I have a db of people in a group and want to allow individual group
members a way to view and update their own contact information, but not
anyone else's. I assume the safest/smartest way is via the php script
checking the user/pwd of the form submitter to determine if the update
query should be allowed (using a user permission given to the script,
not the individual).

Oct 1 '08 #1
2 2541

William Gill schreef:
I have a db of people in a group and want to allow individual group
members a way to view and update their own contact information, but not
anyone else's. I assume the safest/smartest way is via the php script
checking the user/pwd of the form submitter to determine if the update
query should be allowed (using a user permission given to the script,
not the individual).
Hi,

Without knowing the first thing about your setup, I'd say: yes.

I always use sessions for this.
User logs in: If username/password are correct, set $_SESSION["userid"]
= ...
The if they later on change their contactinfo:
$SQL = "UPDATE .... WHERE (userid=".$_SESSION["userid"].");";

Regards,
Erwin Moller
--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================
Oct 1 '08 #2
Erwin Moller wrote:
>
>
Without knowing the first thing about your setup, I'd say: yes.

I always use sessions for this.
User logs in: If username/password are correct, set $_SESSION["userid"]
= ...
The if they later on change their contactinfo:
$SQL = "UPDATE .... WHERE (userid=".$_SESSION["userid"].");";
Thanks, that's what I thought, but I didn't to get midway into
development and have to change my thinking.
Oct 1 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
9
by: James Butler | last post by:
Our setup: Online db: MySQL Inhouse db: MS Access 97 with MySQL tables linked via ODBC Our issue: Almost every field updates successfully, except one. A scenario: Information is written to...
0
by: Donius | last post by:
Hello team. I'm running mysql 4.0.20-standard and i'm trying to do a query like this: INSERT IGNORE INTO `DonorPledges` ( nDonor_id, nPledgeYear, nTotalPaid, nTotalPledge ) SELECT
1
by: jistanidiot | last post by:
We're in the middle of upgrading from MySQL 3.23 to MySQL4.1. I'm trying to import all of the info in the mysql database (ya know the db that keeps track of all the users and what they can and...
5
by: profdotnet | last post by:
Below is the code of web.config file: <configuration> <system.web> <authentication mode="Forms" /> <authorization> <allow users="Admin"/> <deny users="Jack,Mary" /> <deny users="?">...
0
by: David Linsin | last post by:
I created a simple test case to reproduce the problem (also check Bug #15500): import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;...
3
by: eholz1 | last post by:
Hello PHP programmers. I had a brilliant idea on one of my pages that selects some data from my mysql database. I first set the page up to display some info and an image, just one item, with a...
1
by: nhojnesnah | last post by:
I want to add functionality to my site that will enable me to eMail users every time I post a new page or do a significant update. I guess I will need a mechanism to enable my users to register and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.