Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Custom Template
- * Description: A Page for Custom Coding
- */
- get_header();
- global $wpdb;
- $cars = $wpdb->get_results( "SELECT * FROM Cars", ARRAY_A);
- //Shows you what is being returned from your query
- print_r($cars);
- foreach($cars as $car){
- //each record will be run through. Use $car->COLUMN_NAME_IN_DB to select value.
- echo $car->Model . " " . $car->Color;
- }
- get_sidebar();
- get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement