Title: Database connection
Last modified: March 25, 2017

---

# Database connection

 *  [dcopetti](https://wordpress.org/support/users/dcopetti/)
 * (@dcopetti)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/)
 * Hi. I installed the plugin on a test server and it worked great but when I install
   it on the final server it does not create the view in the database.
 * Somebody could help me? What could it be?

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

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8956268)
 * Hello,
 * I don’t understand what you mean by,
 * > it does not create the view in the database
 * the plugin does 2 things,
    - tag post in child-sites to makes them network-side posts
    - custom order these post to display them in the front-end
 * When you say ‘view in the database` are you talking about the MySQL DB or the
   2nd point above?
    -  This reply was modified 9 years, 1 month ago by [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/).
 *  Thread Starter [dcopetti](https://wordpress.org/support/users/dcopetti/)
 * (@dcopetti)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8958921)
 * Hello. Sorry for the misunderstanding.
 * I mean creating a “view” in MySQL. I checked the database of my wordpress installation
   and no “view” was created.
 * If you can pass me the statement to manually create the “view” in MySQL I would
   appreciate it.
 * My english is bad
 * I leave the text in Spanish:
 * Hola. Perdón por el malentendido.
 * Me refiero a la creación de una “vista” en MySQL. Revisé la base de datos de 
   mi instalación wordpress y no se ha creado ninguna “vista”.
 * Si puede pasarme la sentencia para crear manualmente la “vista” en MySQL se lo
   agradecería.
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8966340)
 * Ah, now I understand, sorry I was travelling these last few days and could not
   reply.
 * If your view is not created then it is likely due to database user rights. You
   need to ensure your database user with which WordPress connects has the [CREATE VIEW](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_create-view)
   privilege.
 * Unfortunately I cannot give your the SQL query because it depends on your network
   installation.
 * You can get a print of the SQL query generated by the code to your log file by
   uncommenting lines 117 and 129 in the file `admin/class-network-wide-posts-terms.
   php`. You will need to enable the debug mode in your `wp-config.php` file on 
   your remote server,
 *     ```
       define('WP_DEBUG', true);
        if ( WP_DEBUG ) {
            define( 'WP_DEBUG_LOG', true );
            define( 'WP_DEBUG_DISPLAY', false );
       }
       ```
   
    -  This reply was modified 9 years, 1 month ago by [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/).
 *  Thread Starter [dcopetti](https://wordpress.org/support/users/dcopetti/)
 * (@dcopetti)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8967871)
 * No problem!. I have resolved the “views” of the database. It was a UTF-8 encoding
   problem.
 * Now, the problem is that calling the function `get_network_wide_posts` in the
   index of my theme and show the latest posts causes errors in the other query 
   or loops.
 * Image:
 * In spanish:
    No hay problema. He resuelto las “vistas” de la base de datos. Era
   un problema de codificación UTF-8.
 * Ahora, el problema es que al llamar la funcion `get_network_wide_posts` en el
   index de mi theme y mostrar los últimos posts provoca errores en los demás query
   o loops.
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8967931)
 * Ok, glad you have resolved the views issues.
 * what are the errors you are getting?
 *  Thread Starter [dcopetti](https://wordpress.org/support/users/dcopetti/)
 * (@dcopetti)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8972014)
 * When I put the code that you have given as an instruction, leave the index empty
   as seen in the image. It does not show the other loop with the main site content.
 * Code used:
 *     ```
       $nwposts = array();
       if(function_exists('get_network_wide_posts')){
         $nwposts = get_network_wide_posts();
         foreach($nwposts as $post){...
       ```
   

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

The topic ‘Database connection’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/network-wide-posts.svg)
 * [Network-wide posts](https://wordpress.org/plugins/network-wide-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/network-wide-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/network-wide-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/network-wide-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/network-wide-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/network-wide-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [dcopetti](https://wordpress.org/support/users/dcopetti/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/database-connection-17/#post-8972014)
 * Status: not resolved