Advertisement
Guest User

Untitled

a guest
Jun 28th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Custom Template
  4. * Description: A Page for Custom Coding
  5. */
  6. get_header();
  7. global $wpdb;
  8.  
  9. $cars = $wpdb->get_results( "SELECT * FROM Cars", ARRAY_A);
  10.  
  11. //Shows you what is being returned from your query
  12. print_r($cars);
  13.  
  14. foreach($cars as $car){
  15. //each record will be run through. Use $car->COLUMN_NAME_IN_DB to select value.
  16. echo $car->Model . " " . $car->Color;
  17. }
  18.  
  19. get_sidebar();
  20. get_footer();
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement