473,616 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2549

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=".$_SES SION["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=".$_SES SION["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
5898
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: foriegn key error. I have written example code to use in reproducing the problem: # Create the table
17
5002
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 cust_no, ded_type_cd, chk_no)
9
2131
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 online db. We run an inhouse query to collect info from online db and update
0
2078
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
1336
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 cannot do). I tried just a standard mysqldump from the old box. Copy the file over to the new box. And do a mysql -uroot -p < /tmp/mysqldb.sql. Lo and behold it doesn't work. Looks like there are more columns in some of the tables. Is there...
5
16425
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="?"> </authorization>
0
6159
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; /** * Simple test program to reproduce bug
3
2671
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 row of data, etc. then I thought it would be nice to do a select, and perhaps an update (the title of the image) on the same page.
1
1067
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 then some code somewhere that I can run to send my registered users a link to the new item. My ISP gives me a MySql database where I guess I will have to store my registered users' info. Can anyone point me at the code I neeed to do this? I've...
0
8146
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8592
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8297
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7121
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4063
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4141
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.