Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    8
    Member #
    33743
    I was trying to add some more features to one of my WP codes. So I created few columns under "wp_usermeta" and modified my php code as follows:

    <li>
    <h2><?php echo __('Linkedin Profile','MyTheme'); ?>:</h2>
    <p><input type="text" size="35" value="<?php echo get_user_meta($uid,'user_linkedin_url',true); ?>" name="user_linkedin_url" class="do_input" /></p>
    </li>

    So under "wp_usermeta" I created a row, and entered "user_linkedin_url" for meta_key and left everything else blank. When I manually enter a value (i.e. to meta_value) the site is able to pull that info, but it is not letting my write anything to the database.

    Not sure what I am doing wrong

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Which file did you write that PHP into?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    8
    Member #
    33743
    The user_info.php where a number of other fields such as "user_name", "user_phone" were included. I just duplicated "user_phone" line and past it as a new field, then I changed the meta_key from user_phone to "user_linkedin_url" plus created the SQL row for that.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    You keep saying SQL "row" ... do you mean a "column" you created in the MySQL database table?

    I think there is some further scripting needed if you added a new column.
    Changing the name might be OK, but the column type and character length
    may not be appropriate for the linkedin url.


  6. #5
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    If you just created numeric colums and are trying to insert characters in it.... Also in your insert statement, you're gonna need to define based on the data.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    You also need to be really careful about what file(s) you're updating.

    Let's say that you notice there are newer versions of WP or your theme ...
    If you update a WP version or plug-in or theme, it will overwrite
    anything you've done. You can only update your own "child" theme
    or stand-alone script. Or if you update your site's theme, then you
    can never update the version again for fear of overwriting custom
    changes.
    AlphaMare likes this.


  8. #7
    Junior Member
    Join Date
    Nov 2012
    Posts
    8
    Member #
    33743
    I figured out what the issue was, I wasn't using wp_update_meta to create/add content to the meta key

    Cheers


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:19 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com