MySQL view is not found using get_data

I created a view using phpmyadmin. The view is querying elgg tables. When querying the view using MySQL Workbench or phpmyadmin results are returned but not when using php. I get a fatal error. Can get_data only fetch core tables and not views?

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #c33720} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #34bbc7} span.s1 {font-variant-ligatures: no-common-ligatures; color: #ce7924} span.s2 {font-variant-ligatures: no-common-ligatures; color: #34bbc7} span.s3 {font-variant-ligatures: no-common-ligatures; color: #000000} span.s4 {font-variant-ligatures: no-common-ligatures} span.s5 {font-variant-ligatures: no-common-ligatures; color: #d53bd3} span.s6 {font-variant-ligatures: no-common-ligatures; color: #c33720}

$thewire_relatioships_sql = "select * from custom_thewire_relationships";
$thewire_rows = get_data($thewire_relationships_sql);
$thewire_rows_string = print_r($thewire_rows,true);
elgg_dump($thewire_rows_string);
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking