Try below code. it will get all data from that table and update page content. you can modify as per your need. let me know if this works for you.i assume that $inf->name is return just names.
function update_insert_page() {
global $wpdb;
$table_name = $wpdb->base_prefix . 'portalorgs';
$info = $wpdb->get_results( "SELECT * FROM $table_name" );
$orgname="";
if(!empty($info))
{
foreach ($info as $inf) {
$orgname .= 'Name :'.$inf->name.'<br/>';
}
$insertpage = array(
'ID' => 224,
'post_content' => $orgname
);
wp_update_post( $insertpage );
}
}
Related Posts:
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- Update results, Before deleting the related category [closed]
- wp query foreach deleting record returning only first or last item
- Custom array from a query only write the last row of the query
- select a single val though a table in wordpress
- Unable to pass variable to database
- $wpdb->insert writes a record twice for some reason, when my custom developed plugin calls my class function once
- How to properly prepare a column name if passed to a stored procedure?
- Can’t get wp_insert_post to work
- Trying to establish connection to External Database
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- Getting id of poll from WP database
- How to insert a single row to WP database table?
- WSoD being caused by this piece of code
- How to access global variable $menu inside a class function
- I want to select the from values from database in WordPress? [closed]
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- How can I remove a function that has been added to wordpress with add_filter?
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- $wpdb->update with multiple parameters gives error
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- How to upload a file to a folder named after the user_id via plugin
- Querying wpdb using PHP
- Reprinting tags with all attributes
- Use custom post type for a store locator
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Improve page speed loading using CDN and async or defer attribute
- How do I programmatically set a user as spam in BuddyPress? [closed]
- How to use $_GET function WordPress backend
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- How to call plugin function per site in a multisite?
- How to make my custom widget appear within WordPress widgets? Plugin development
- Script to browser problem PHP
- adjust section according to country?
- How to auto fetch customer details in Woocommerce in checkout page
- Can’t upload image using media_sideload_image
- Store a default value for a transient on plugin activation
- Adding widgets to my plugin page instead of WordPress dashboard
- WP CRON duplicate wp_insert_post with has < and > tag
- How wp-cron can run in background if PHP is single threaded?
- How to insert data into database using wp cron job
- How to send Ajax request from my plugin in admin dashboard?
- How WordPress reacts to a lack of memory of the server [closed]
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- I want to add custom add to cart link [closed]
- Options API get_option() and update_option() Not Correctly Updating or Returning
- Execute long and heavy processes
- wp_head function not outputting
- Extend PHP regex to cover “srcset” and “style” attributes
- Adding function to Genesis genesis_header [closed]
- AJAX success response is not working but it’s saving my changes
- Access Child Class of Plugin Main Class Instance
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- Database query works fine outside WordPress
- How to make own crop image function for WordPress plugin
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- WordPress Custom field Colors
- Best practice for show data to one specific user?
- $wpdb->insert() does not Insert record in a table
- How can I hide that I Use WordPress (with W3 Total Cache)
- how to update and display an option without reloading the page
- Font Awesome changing default WordPress Font
- Help with a $wpdb MySQL Query
- Saving plugin settings – ERROR: options page not found
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- class_exists returns different values [closed]
- “Undefined index” error when saving empty array with checkboxes
- Fatal error: Call to a member function query() on a non-object
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- Download full html page with CSV export plugin
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Asynchronous multiple requests 401 Unauthorized
- How to use html inside a functions.php code?
- How to hook code to show after the_content?
- Plugin Generate Unexpected output during activation
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- Issue running db create table query from static method
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Undefined method class::construct() when creating a plugin
- Using and saving custom dropdown boxes on user profiles
- Error using WordPress $wpdb object to get result from custom table
- How to retrieve the data from the sever and displaying it in a page?
- Hook called before text widget save
- plugin add action hook is not working :
- wp_insert_post: array only. wp_update_post: array|object (?)