Ecommerce Shopify WordPress Discussion

How To Get Display Post Title Using Post ID from mySQL

I am stuck on trying to get my PHP code to work. I can display the table for each user as expected with the code below. I have one field that is post id, and I would like this to display the post title. Just to clarify, I'm looking at the edit in the h3 tags. the 'postid' is a column in a MySQL table. This is captured from a form submitted <div> <?php global $wpdb; $current_user = wp_get_current_user(); $user_id = $current_user->ID; $result = $wpdb->get_results( "SELECT * FROM wp_test where userid=".$user_id." order by arrival ASC" ); foreach ( $result as $print ) { ?> <div style="margin-bottom:20px;"> <h3 style="font-size:1.5rem;"><?php echo $print->postid; ?></h3> </div> <?php } ?> </div>
Use this: <?php echo get_the_title( POST_ID ); ?>

February 4, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.