I followed guidance from here on creating a Widget in WordPress, they say to create a plugin widget which I have done and it does display Hello World
as expected.
But now I want to run a mysqli query inside this widget. I can't find anywhere to supply information on this as I know the query I want to run is
SELECT * FROM wp_posts WHERE post_type = 'facts'