28, May 2012

adding new fields to the profile table - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: adding new fields to the profile table
« previous next »
Pages: [1] Print

Author Topic: adding new fields to the profile table  (Read 2839 times)
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: Apr 22, 2006, 08:01:58 am »

question:
how to add new fields to the class?
How to integrate them into the profile extension of the access user class (file ext_user_profile.php) ?


solution:
1. add new fields to the config file:
Code:
define("TBL_USERFIELD_5", "user_5");
define("TBL_USERFIELD_6", "user_6");

2. Add them to the database table too
Code:
ALTER TABLE `users_profile` ADD `user_5` VARCHAR( 150 ) NOT NULL AFTER `user_4` ,
ADD `user_6` VARCHAR( 150 ) NOT NULL AFTER `user_5` ;

3. modify these functions inside the file "ext_user_profile.php"
a. adding vars
Code:
var $field_five;
var $field_six;
b. modify the methods (function) "save_profile_date" and "get_profile_data". Note the var names like $field4 and the contants like TBL_USERFIELD_4

4. after that you can acces the vars $field_five and $field_six in you application

It's better to build this inside a new extenstion of the class because of later updates in this class (this is a hint for the more experienced user)
« Last Edit: May 07, 2006, 09:52:35 pm by olaf »

Chicken-run Manager
*
Gender: Male
Posts: 9
62 credits
Members referred : 0



« Reply #1 on: Aug 30, 2006, 08:35:31 am »

Easy and convinient way of doing it ! I merely just added a whole array of new items, which did mean some seraious typing had to be done ! But thanks for the good clarification !
Anders
Guest


Email
« Reply #2 on: Nov 28, 2007, 10:55:09 pm »

Great class use it on all my  sites
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2345
Tags : databases Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: adding new fields to the profile table
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:50:50 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.