Title: problems with database Full update
Last modified: November 9, 2022

---

# problems with database Full update

 *  Resolved [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/)
 * I have a problem with update data in WordPress Data base. I get fetch request,
   that got me 2,4Mb information, but when i try to push it into custom table by
   function:
 *     ```
       add_action( 'wp_ajax_updateDB', 'updateDataBase' );
       function updateDataBase(){
           global $wpdb;
           $table_name = $wpdb->get_blog_prefix() . 'sports_viewer';
           $wpdb->update(
               $table_name,
               array(
                   'json' => $_POST['text'],
                   'object_last_modified' => current_time( 'mysql' ),
               ),
                array('id' => 1),
                array('%s'),
           );
           wp_die();
       }
       ```
   
 * It’s pushing only 16kB of information. I can’t find fow to fix it.
    *cell’json’
   has type – `MEDIUMTEXT`
    -  This topic was modified 3 years, 7 months ago by [BlackStar](https://wordpress.org/support/users/blackstar1991/).
    -  This topic was modified 3 years, 7 months ago by [BlackStar](https://wordpress.org/support/users/blackstar1991/).
    -  This topic was modified 3 years, 7 months ago by [BlackStar](https://wordpress.org/support/users/blackstar1991/).

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16182934)
 * I would first recommend debugging what arrives at the server via AJAX. For this
   you can simply output values via var_dump() and can look at the response in the
   network tab of your browser.
 * Example:
 *     ```
       function updateDataBase(){
        var_dump($_POST);wp_die();
       }
       ```
   
 * If you see here that ‘text’ is already truncated at this point, then your AJAX
   request would be responsible.
 *  Thread Starter [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183044)
 * I see Headers parameter `Content-Length: 2059630` in Chrome DevTools, but `var_dump(
   $_POST);` show me nothing in php function
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183061)
 * What do you mean by “show me nothing in php function”? You should at least see
   an output like `array() {}` if the POST request is empty.
 *  Thread Starter [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183127)
 * On the html page, when I started AJAX request pushing on a button I see nothing
   changes;
 *     ```
       function updateDataBase(){
           global $wpdb;
           $table_name = $wpdb->get_blog_prefix() . 'sports_viewer';
           var_dump($_POST . ' dick');
           print_r($_POST);
           wp_die();
       }
       ```
   
 * NO array.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183179)
 * Then the function will not be executed. Are you sure it is exactly this one? 
   What comes back as response of the AJAX request?
 *  Thread Starter [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183397)
 * I see request [http://joxi.ru/Rmzy38McV9ZzXr](http://joxi.ru/Rmzy38McV9ZzXr)
   
   But when I show result AJAX in console I got –> [http://joxi.ru/VrwxZ1JcgldQjm](http://joxi.ru/VrwxZ1JcgldQjm)
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16183408)
 * I guess in your first screenshot you can see the post content. But this is not
   an array but a string, which is strange. Have a look at how you define the AJAX
   request in JavaScript.
 *  Thread Starter [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16184741)
 * My js code look like
 *     ```
       async function getData() {
               let response = await fetch('https://api1.test.com/');
               if (!response.ok) {
                   const message = <code>An error has occured: ${response.status}</code>;
                   throw new Error(message);
               }
               let result = response.json();
               return await result
           }
       $('#btn_update').click(function(){
   
               getData().then((data) => {
                   const sportsJsonString =  JSON.stringify(data, null, "\t");
                   console.log("sportsJsonString", sportsJsonString);
                   fetch(ajaxurl, {
                       method: 'POST',
                       headers: {'Content-Type': 'application/x-www-form-urlencoded'},
                       body: <code>action=updateDB&text=${sportsJsonString}</code>
                   })
                       .then((data) =>{
                           $('#btn_update').text('Повторно обновить');
                       })
                       .catch(err => console.error(err));
               })
           });
       ```
   
 * Why strange for you, that variable type of ‘sportsJsonString’ – string? If I 
   push ‘data’ variable into table cell, I got `[object Object]` in this `json` 
   cell.
    -  This reply was modified 3 years, 7 months ago by [BlackStar](https://wordpress.org/support/users/blackstar1991/).
 *  Thread Starter [BlackStar](https://wordpress.org/support/users/blackstar1991/)
 * (@blackstar1991)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16193441)
 * During testing, I realized that the browser does not allow to write >415kB to
   the database (Chrome or FF makes no difference) It’s browser problem.
 * You can check it if you interrupt operations when accessing the file `wp-admin/
   admin-ajax.php’
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16193471)
 * The browser does not know about a database running only on the server. I am not
   even aware of such a limit. Where did you get this value?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘problems with database Full update’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 10 replies
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/problems-with-database-full-update/#post-16193471)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
