<?php $mydb = new wpdb('starlabadmin','starAdmin2300','starlabs_database','mysql.duncan.suncoastscience.org'); $sql = "SELECT * FROM `ScienceBadges` WHERE `BadgeNum` = 1;"; $results = $mydb->get_results($sql); if ($results) { foreach ($results as $row) { $badgeNum = $row->BadgeNum; $badgeName = $row->BadgeName; $imageLink = $row->ImageLink; echo "<img src=$imageLink>"; echo "<p>BadgeNum: {$badgeNum}</p>"; echo "<p>BadgeName: {$badgeName}</p>"; } }