Jump to content

Setting a default value for a column...


Recommended Posts

Is it possible to set a default value for a column based on what is entered in other columns?

 

Example:

 

Column A:  nameFirst

Column B:  nameLast

Column C:  'nameFirst'-'nameLast'

 

So as I type in the A and B, C self populates.

 

 

I see in my column properties, there is a Default option, but I'm not sure I can put variables in there from other columns. 

 

 

Link to comment
https://forums.phpfreaks.com/topic/212405-setting-a-default-value-for-a-column/
Share on other sites

I figured that would be one of the responses.  What I'm trying to do is create within my database a value to match WordPress slugs in a separate data table I use for personal information for basketball players.  It works very well.  Just that each year, I enter about 150 names at one setting, and it would be nice to have some of it auto-populate.

 

 

I put their personal information on their Tag Archive page, so as you click on their tag to see everything they're tagged in, you see their height, school, position, school coach's name, and anything else I choose to put in there.

 

 

Additionally, I'm not inserting.  I'm typing directly into my database, via SQLyog--a great tool.  I was hoping I could set a default value for a column based on the variable output of two other columns.  You're saying that is not the case?

 

YES...that's where I was going with my request.  I'm just up with all (or much) terminology.  If it was a spread sheet, I'd have =[column A]-[column B]  (I need the hash in between)

 

Is it simple like that, or should I just start digging around?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.