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
- How can I save a multiple select array with the settings API for a plug-in options page?
- error_log() output for print_r() appearing on page
- $wpdb->get_results(…) returns empty array despite correct query
- Allow only 1 taxonomy per custom post type [duplicate]
- $wpdb->delete column values IN ARRAY()?
- Do I require the use of nonce?
- Retrieve multiple values passed to a single attribute in a shortcode
- How to change date language without changing the entire site language?
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- How to display only first value of database column in WordPress
- OOP Plugin Development. Including external object
- Authenticating to WordPress, using my own authentication two-factor system
- Use composer to load custom classes [closed]
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- Create table in database when activating plugin
- Problem with WordPress Ajax form
- allow user to select pages from dropdown in my plugin
- Using Font Awesome as post thumbnail
- Export WordPress Table to CSV from page
- How to set a custom path, for ajax image upload folder in admin?
- admin-ajax.php responding with 0
- custom shortcode will not display the wrapped content
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- WordPress php filter admin_body_class not working
- Common abstract class for plugins
- $wpdb->flush(); breaks the loop
- How to test nonce with AJAX – Plugin development
- Same log message keeps on printing to debug.log file thousand of times
- database interactions using OOP
- Append HTML Using Shortcode
- Create onClick Event to Re-load a Widget
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to select the contents in the text view textrea in wp_editor?
- How to auto fetch customer details in Woocommerce in checkout page
- Can’t upload image using media_sideload_image
- I want to add custom add to cart link [closed]
- Execute long and heavy processes
- Font Awesome changing default WordPress Font
- Help with a $wpdb MySQL Query
- Download full html page with CSV export plugin
- $wpdb returns duplicate posts
- Usage of call back function of add_meta_box()
- how to save checkbox data for custom setting?
- How to Schedule Cronjobs for start of every month and year
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- WPDB secure custom form
- Removed jQuery script from header.php , any problems?
- How can I get plugin meta data without knowing the plugin folder?
- calling admin-ajax.php from admin-ajax.php
- Query the links Database
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- How does add_option() function enable action hooks to fire right after actiavtion?
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- Settings API form – submit with AJAX
- Submit remote form to wordpress REST API and save data to custom post type
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- How to import woocommerce custom fields data into another site?
- Add a custom link to each image in WordPress gallery
- How to access this jQuery/AJAX data in a PHP file/WordPress plugin
- post_exists stops working in a scheduled event
- Taxonomy Child Term, Counter is staying on 0
- Need help with format of nested array in MySQL
- How to add delete, approve, spam Links to Comments
- problem in using wpdb->prepare and a string placeholder
- Help on Wp_query to print an term
- Advanced WordPress SQL Query
- Upload images from one server to an other in wordpress
- Setting at job with shortcode not working
- Run code before WordPress loads and insert data into WP if need be
- PHP: Why does my code work in index.php but not a widget?
- MySQL query in WordPress with AJAX
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Order by in foreach
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- I’m not able to get access $wpdb in my php file in wordpress
- How do I change the Go To Categories link in the term_updated_messages
- How to display inputted data in Ajax without button or click event
- How to get data (not value or name) from radio options to POST to database
- Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?
- Woocommerce Convert existing order to the cart
- Redirect posts to post editor page based on query string
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end
- Putting form result in my database
- SQL – How to echo out inside of where statement
- How can I update a value of a field depending on outside source?
- Issue with WordPress Plugin Activation Hook and Table Creation
- Too few arguments – wp_login action