Getting a loop through an external schema table seems like it should be pretty clear cut, but since I’m in noob territory my guess is that my query syntax is wrong?
Function:
public function tidestations() {
global $wpdb;
$tidedb = new $wpdb('example', 'example_dbpassword', 'exampledb', 'localhost');
$ta = $tidedb->get_results("SELECT station FROM conditions WHERE id > 0");
return $ta;
}
Blade:
@foreach ($tidestations as $ts)
{!! $ts !!}
@endforeach
Error:
Warning: Invalid argument supplied for foreach()
In the successfully connected schema, the conditions table has 3 columns: id, stations, waterlevel