22, November 2008

adding new fields to the profile table - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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 1810 times)
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« on: Apr 22, 2006, 09: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, 10:52:35 PM by olaf »


Last blog : Just a better Internet portal provided by Google
Chicken-run Manager
*
Gender: Male
Posts: 9
62 credits
Members referred : 0



« Reply #1 on: Aug 30, 2006, 09: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, 11: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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Nov 22, 2008, 11:19:45 PM





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!


Forum Statistics
Total Posts: 37.741
Total Topics: 7.651
Total Members: 4.398
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: egseopro

30 Guests, 4 Users online :

11 users online today:



Readers

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