is it right choose to connect database in template page directly in WordPress site?

If you make data manipulations with mysqli_connect() right, according to database structure etc, it will not break your site. But it’s more safe and logical to use build-in functions to manipulate database data. (Some standarts exists). WordPress has a lot of functions, which allows you to manipulate each wp table’s data. Here are some simple … Read more

Wpdb query with dynamic table name

I will start with the question. From the sql error output we see this SELECT * FROM WHERE dbID = 719 This tells us that $sanitized_search_language has no value, so check it first. Now for the BIG problem with this query! You used get_results with a sql query that has variables as is, get_results doesn’t … Read more

How do I use a database in a custom theme?

Alright, You did not mention if that data will be stored upon submission from front end or you want to manually put that in. But lets see the way I would handle form submissions and store email addresses. I would use contact form 7 along with its addon Flamingo. It will let you store all … Read more