PDA

View Full Version : Adding field to Member table?


10-08-2000, 11:54 PM
On our old board we had added a field to allow people to add their City, State. Then we had it display in their post. We found alot of people like seeing where members were from. We are a Mustang site and this option was a nice addition. Since the change alot of people have been inquiring about it.

Is is dangerous to add a field to the table? I could do this easily with phpMyAdmin. Then I could just work the code to give the blank in the user profile field and call the field in the thread display.

Is this possible without screwing up the DB?

Thanks for any input.

MRaburn
StangNet.com

10-09-2000, 12:02 AM
Add as many fields as you want, it won't harm a thing. I've add several fields myself to use the users table as a hub for other applications, and I haven't run into any problems to date.

10-09-2000, 12:07 AM
Thanks for the reply....

As many as you want!?!?

I was thinking what if I could add fields for like car mods, track times, URL to pictures of their cars, time slips, etc... would this be viable??

Then create some kind of special link to go to like...

"Readers Rides" and pull the info out of the Database... this would work?

almost making it like a stand alone program but all in the same... ??

Thanks!
Mike

10-09-2000, 12:12 AM
Yup - as many as you want. Over at http://www.vbulletin.org (the only vB hacking site. [hehe]) we've tied the hack database into the vB and added approximately 17 fields to the forum table. :)

As long as you know the code to grab the info from the db, you'll be fine.

10-09-2000, 12:18 AM
So basically,

Im going to add about 20 fields the the users profile.

Copy the member.php file, rename it, make it call new templates with all the data I want pulled in a nice arrangement. Then they would have to login and edit their profile just like anyone else.

hmmmm....

Basically when they join, I am going to have to have all the fields ready to be filled in and let it be optional... because if I dont then if they 'edit' their member profile, if those blanks that are like their car, etc... will MySQL write blanks to the fields if thet are not their to be filled in??

I guess what I am trying to say... if they edit their profile on the board with a normal link, and it only shows the normal fields, and the 'new' ones arent called, will the DB write blanks to those fields not shown or leave them intact?? I know it sounds confusing... just wanting them to have a way to edit just their user info with one link and then another 'new' link to fill in all of their car info..

Thanks
Mike

10-09-2000, 12:19 AM
Wouldn't more fields make it run slower? I know with access db's having more fields makes it slower...

10-09-2000, 01:14 AM
Mike - if you specify the fields as NOT NULL, then MySQL will just write the default value you set for that field (0, 1, empty - whatever). I suggest you set NOT NULL anyway - it'll make if a slight bit faster.

John - Not noticably. As long as you don't search through the fields you added, very little should happen. However, the more fields you want to pull, the slower the query will become (especially with BLOBs)

10-09-2000, 05:16 AM
Access shouldn't be considered a database :)

10-09-2000, 11:20 AM
I am trying to use phpMyAdmin to add a field to the 'user' table.

But for some reason I do this action and it says its done, but when I go back to look, the field is not added.

What am I doing wrong? :)

EDIT: OK, I was trying to add a field of 'MEDIUMTEXT' and that is why it would not add, I was only trying to add 50 charec. to the field.

What is the minimum if I wanted to make it a MEDIUMTEXT Field for future reference??

Thanks!

Mike

[Edited by MRaburn on 10-09-2000 at 08:30 AM]

10-09-2000, 01:22 PM
Don't give it a size ;)

....or you could take a look at mysql.com

10-09-2000, 01:34 PM
You can also just make another table and give it a userid field that matches the userid in the user table and then do a join when you query the data.

10-11-2000, 11:02 PM
what's a blob?

dwh
blobbing apples

10-11-2000, 11:13 PM
A blob is a field that has variable size data in it.

Refer to this link for more information on blobs -> What is a blob? (http://us.imdb.com/Details?0051418)