Advertisement
NubeColectiva

Como Usar Otra Base de Datos en WordPress

Apr 11th, 2024 (edited)
826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. $midb = new wpdb('usuario','password','base_de_datos','localhost');
  2.  
  3. $rows = $midb->get_results("select titulo, detalles, created_at from wp_datos ORDER BY created_at DESC");
  4.            
  5. foreach ($rows as $row) {
  6.  
  7.     echo esc_html($row->created_at);
  8.     echo '<br/>';
  9.     echo htmlspecialchars_decode(esc_html($row->titulo));
  10.     echo '<br/>';
  11.     echo htmlspecialchars_decode(esc_html($row->detalles));
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement