cannot connect database

While it may possible to connect using mysqli->connect it is always better to make use of built in WordPress functionality (even for external code). By this I mean that you should use the wpdb class. See https://codex.wordpress.org/Class_Reference/wpdb for more information. First you need to link to the WordPress class: echo ‘<h1>WP Connect DB</h1>’; echo ‘<p>Directory … Read more

Debugging – logging database queries

The debug log will only capture PHP-generated errors as well as things you manually send yourself. So if it is not being created right now, then there are no warnings/errors being generated by PHP right now. In order to send things manually, you use error_log(). One quick note though is that you have to set … Read more

pre-existing data, and entities

Well the question is do you want to leverage WordPress or do you want to use your custom data. You can build fairly complex things in WordPress even with a plugin like Advanced Custom Fields, make a bunch of custom post types that all have different custom fields(some of which can be other post objects, … Read more

How to get image from url from the database?

I’d highly recommend to escape all values before output, e.g. echo esc_html( $retrieved_data->NAME ). The same for the image: <img src=”https://wordpress.stackexchange.com/questions/292680/<?php echo esc_url( $retrieved_data->icon ); ?>” /> You can read more about Securing Output in the developer handbook.