homepage Welcome to WebmasterWorld Guest from 54.161.175.231
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
php member profile page
php profile pages
roclimb




msg:4413207
 7:24 pm on Feb 1, 2012 (gmt 0)

I have a PHP login script/ login for my website that stores name and password and email in an SQL database called "members". After the members login I have them directed to a member profile page. I would like them to add a description about themselves, gender, location and stuff like that to this member profile page.

My question: Can I have them add this to a different database other than the "members" one I have for the login. Also if I do this how can I pull the name and password they already entered and echo it on the profile page with the info they enter from the other "lets say profile" database I make?

Thanks

 

abushahin




msg:4413638
 8:03 pm on Feb 2, 2012 (gmt 0)

Hello roclimb, is there a special need for another database? or do you mean another table which is within the same database?
if so you can have another table that has a relationship with the members table called profile table.
Do you know much about relational databases? depending on how many rows a member needs in the profile table you may have a 1 to 1 relationship or 1 to many relationship. If it is a 1 to 1 relationship then keep all the data in the members table but keep the fields optional so that it can be updated afterwards. if that makes sense.

roclimb




msg:4414106
 12:23 am on Feb 4, 2012 (gmt 0)

thanks for the reply. I think I understand what you are saying.
Basically I have a login that requires username and password and email. After logged in I have things redirected to an "optional" member profile page. If a member wants they can add a description about themselves, a photo, and part of the us they are from.
I guess I will just add the latter three into new rows in the member table? and leave the latter null so they can choose to add those fields or not?
Thanks again for any help you can give

cffrost2




msg:4414139
 3:49 am on Feb 4, 2012 (gmt 0)

hey roclimb. I think abushahin is saying create another table called "profile" in the members database to store the additional member data.

I.E.

<?php
$memberaboutme = $_POST['memberaboutme'];
$memberlocation = $_POST['memberlocation'];
$memberid = int($_REQUEST['memberid']);//this will be the ID of the data row in the member table assuming you use one.

//Insert it into the member database, profile table
//The first VALUE('', is where you would have an id auto set using "auto increment"
mysql_query("INSERT INTO profile VALUES('', '$memberid', '$memberaboutme', '$memberlocation')")or die(mysql_error());

?>


I hope this helps.

henry0




msg:4414219
 2:12 pm on Feb 4, 2012 (gmt 0)

If the members are already registered with a PW and a UN
I won't use auto increment for the new table, but an insert including the last entered ID so there is an easy connectivity in between tables.
now if there are just few fields in the membership table why complicating things add a few new fields in the existing table.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved