WordPress.org

Ready to get started?Download WordPress

Forums

Returning mysql table data (3 posts)

  1. amory
    Member
    Posted 9 years ago #

    What i have done is create four extra inputs within the write>post form for a bike club's website that I'm creating (ride distance, location, contact info, and departure time). I have everything running successfully, in that when i publish a post, the values for the four new inputs are being stored in separate places within mysql.

    Not being too knowledgeable with PHP, let alone mysql, I'm susprised i was able to get that far. Now, however i can't return the values within each post. I don't need to manipulate the data at all, simply output it. I have looked at many plugins, as well as the template-functions-post.php file to get an idea as to how to go about this and have failed in all attempts. Can anyone could give me a basic example function of how to return data from a specifc table?

  2. ColdForged
    Member
    Posted 9 years ago #

    Did you make new columns in the wp_posts table? If so, you're in luck, because columns in the wp_posts table are automatically populated in The Loop, and you can access them by simply doing this:

    <?php echo $post->my_column_name; ?>

    If you didn't make new columns in the wp_posts table... why don't you? ;)

  3. amory
    Member
    Posted 9 years ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.