Guest User

plug

a guest
Aug 25th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. include "dbconf.php";
  2.  
  3. function create_conn()
  4. {
  5.     //global $wpdb; mindegy hogy kivan-e kommentelve a hiba ua.
  6.     $mydb = new wpdb($dbuser,$dbpass,$dbname,$dbhost);
  7.     //echo "<font color='yellow'><center>DB CONNECTION</center></font>";
  8.     $rows = $mydb->get_results("select nev from gems");
  9.     echo "<ul>";
  10.     foreach ($rows as $obj)
  11.         {
  12.             echo "<li>" .$obj->nev. "</li>";
  13.         }
  14.  
  15.     echo "</ul>";
  16.  
  17.     $mydb->show_errors();
  18. }
  19.  
  20. add_action('init','create_conn');
Advertisement
Add Comment
Please, Sign In to add comment