wordpress – Looking for advice on completing a custom MySQL query for 3 different tables

I want to create a query to dynamically populate a table by querying the 3 databases that contain relevant information about their entry.

wp_gf_entry, wp_gf_entry_meta and (ideally) with wp_posts

The query works with the wp_gf_entry and wp_gf_entry_meta tables.

SELECT 
  t2.id, 

  MAX(CASE WHEN t1.`meta_key` = '1.3' THEN t1.meta_value END) firstname,
  MAX(CASE WHEN t1.`meta_key` = '1.6' THEN t1.meta_value END) lastname,
  MAX(CASE WHEN t1.`meta_key` = '5.4' THEN t1.meta_value END) state,
  MAX(CASE WHEN t1.`meta_key` LIKE '%45.%' THEN t1.meta_value END) division

FROM
  `wp_gf_entry_meta` t1 
  LEFT JOIN `wp_gf_entry` t2
    ON (
      t1.`entry_id` = t2.`id` 
    )
WHERE (
    t2.`form_id` = 71
    AND t2.`is_read` = 1 AND t2.`status` = 'active' 
        AND t1.`meta_key` IN ('1.3', '1.6', '5.4', '45.1', '45.2', '45.3', '45.4', '45.5', '45.6')
  )
  GROUP BY t2.`id`
ORDER BY 
    t1.`id` ASC,
    t1.`entry_id` ASC

This works fine IF the entry & # 39; read & # 39; and the entry is not & # 39; discarded & # 39; has been.

+-----+-----------+----------+-------+------------------------------+
| id  | firstname | lastname | state |           division           |
+-----+-----------+----------+-------+------------------------------+
| 166 | Steve     | Jobs     | QLD   | (null)                       |
| 253 | Bill      | Clinton  | NSW   | (null)                       |
| 427 | Maria     | McOldguy | VIC   | Grand Master's (65 and over) |
| 447 | Some      | Bloke    | NSW   | Master's (60-64)             |
+-----+-----------+----------+-------+------------------------------+

However, this query still requires a human to interact with the site several times a day to process entries (marked as read) – as entries are still written to the database, regardless of whether the entry was successfully paid or not.

Here I would like to query the wp_posts table with the key and value pair woocommerce_order_number stored in the wp_gf_entry_meta line for each entry.

So the query changed that the woocommerce_order_number was dragged into the array and what I thought could be queried:

SELECT 
  t2.id, 

  MAX(CASE WHEN t1.`meta_key` = 'woocommerce_order_number' THEN t1.meta_value END) wcID,
  MAX(CASE WHEN t1.`meta_key` = '1.3' THEN t1.meta_value END) firstname,
  MAX(CASE WHEN t1.`meta_key` = '1.6' THEN t1.meta_value END) lastname,
  MAX(CASE WHEN t1.`meta_key` = '5.4' THEN t1.meta_value END) state,
  MAX(CASE WHEN t1.`meta_key` LIKE '%45.%' THEN t1.meta_value END) division

FROM
  `wp_gf_entry_meta` t1 
  LEFT JOIN `wp_gf_entry` t2
    ON (
      t1.`entry_id` = t2.`id` 
    )
WHERE (
t2.`form_id` = 71
    AND t2.`is_read` = 1 AND t2.`status` = 'active'
        AND t1.`meta_key` IN ('1.3', '1.6', '5.4', '45.1', '45.2', '45.3', '45.4', '45.5', '45.6', 'woocommerce_order_number')

  )
  GROUP BY t2.`id`
ORDER BY 
    t1.`id` ASC,
    t1.`entry_id` ASC

The above query gives me a column with the Woocommerce Order ID:

+-----+------+-----------+----------+-------+------------------------------+
| id  | wcID | firstname | lastname | state |           division           |
+-----+------+-----------+----------+-------+------------------------------+
| 166 |    1 | Steve     | Jobs     | QLD   | (null)                       |
| 253 |    2 | Bill      | Clinton  | NSW   | (null)                       |
| 427 |    3 | Maria     | McOldguy | VIC   | Grand Master's (65 and over) |
| 447 |    4 | Some      | Bloke    | NSW   | Master's (60-64)             |
+-----+------+-----------+----------+-------+------------------------------+

However, I want to eliminate the human factor by adding the following to the WHERE statement

SELECT 
  t2.id, 

  MAX(CASE WHEN t1.`meta_key` = 'woocommerce_order_number' THEN t1.meta_value END) wcID,
  MAX(CASE WHEN t1.`meta_key` = '1.3' THEN t1.meta_value END) firstname,
  MAX(CASE WHEN t1.`meta_key` = '1.6' THEN t1.meta_value END) lastname,
  MAX(CASE WHEN t1.`meta_key` = '5.4' THEN t1.meta_value END) state,
  MAX(CASE WHEN t1.`meta_key` LIKE '%45.%' THEN t1.meta_value END) division

FROM
  `wp_gf_entry_meta` t1 
  LEFT JOIN `wp_gf_entry` t2
    ON (
      t1.`entry_id` = t2.`id` 
    )
WHERE (
t2.`form_id` = 71
        AND t1.`meta_key` IN ('1.3', '1.6', '5.4', '45.1', '45.2', '45.3', '45.4', '45.5', '45.6', 'woocommerce_order_number')

        AND t1.`meta_value` IN (SELECT t3.ID FROM wp_posts t3 
                WHERE t3.ID = (wcID)
                    AND t3.`post_status` IN ('wc-processing', 'wc-completed', 'wc-free-of-charge') 
                    AND t3.`post_type` = 'shop_order' )
  )
  GROUP BY t2.`id`
ORDER BY 
    t1.`id` ASC,
    t1.`entry_id` ASC

Result of this error message "Warning: # 1292 Incorrect DOUBLE value truncated: & # 39; wcID & # 39;".

And I'm not sure how to refine this final AND statement.

SQL Fiddle location

Is there a way to query the wp_posts table and the id column with alias wcID woocommerce_order_number?

Advice / suggestions for a website

Hello everybody
We create a management definition / terminology website for the client (something like these websites https://www.skymark.com/resources/qualglos.asp https://www.12manage.com/management_dictionary.html).

I would be happy to receive your suggestions and suggestions on:
1) Cheapest way to add content?
With thousands and thousands of definitions in this niche, with only a small budget available, we're looking for creative, cost-effective ways to add such content to the site.
– Allow people to sign up and contribute as members of the site and then reward them in kind by paying them nominal dollars, providing them with advertising space and publishing some of their links to the site to let. As new definitions are created on a daily basis (other than existing ones), this member pool regularly generates and updates the most recent new content so that the content is generated by the user.
– Copy definitions from other websites and pay the author to rewrite them to be original. – This would be expensive and the website administrator has to pay regularly, because such content is not generated by the user.

2) What other features / sections should we add?
The goal is to make this site a one-stop portal with information / knowledge / databases on this management / business niche, so the sites must have many features / areas to keep visitors coming back.
-Blog? Get volunteer and guest posters to periodically post posts with backlinks to their website.
-Forum? Is it relevant and useful for such a niche definition / terminology site?
Feed from other authorities in this niche
News Feed with breaking news and social media (FB, Twitter, IG) relevant comments

3) The best way to make money?
Google AdSense?
-Amazon (since such definitions / terminology usually come from an author or a book, so can an Amazon affiliate link be added)?
– sell banner / links?
How can I best monetize such a website?

Any advice and suggestions would be very grateful. thank you in advance

greetings :)
SEMrush

dnd 3.5e – Call of Cthulhu – Eberron Crossover Advice

"Lovecraftian" in Eberron immediately recalls the Daelkyr of Xoriat; The typical approach to a game that is interested in these concepts would be that something goes wrong, either with the lunar seals operating from the druidic circle of gatekeepers and keeping Xoriat away from Eberron, or with the seals in Khyber holding the Daelkyr still holding on to Eberron of late (which has destroyed the Dhakaani Empire for 10,000 years)1 accidentally open Khorvaire for eventual human population prior to the typical campaign launch2 and conquest).

A campaign to turn all thirteen moons into representatives of the Lovecraftian myth means changing the nature of the campaign and making a pretty good deal. So I'm assuming you're looking for it. For the most part, this is not such a big problem – with the possible exceptions of Dal Quor and Dolurrh – but there is one fairly important high level concern here: Lovecraft's approach to horror is about the insignificance of mortal existence and the impossibility of knowing it true truth of the universe.3 This is a problem for two reasons:

  1. Dungeons & Dragons is a system primarily interested in the epic tales of world-saving heroes. It is almost assumed from the beginning that they are are will save the princess / kingdom / country / world / existence as we know it. And its mechanics allow adventurers to produce capable and capable individuals with great power – downright absurd, especially in D & D 3.5e. I mean, from the 17th level, a magician can "genesisAnd it does exactly what it promises, and it does not need anything special, any special class features or preparations, or anything other than the usual rules of learning and magic.

    D & D magic is phenomenally powerful and can easily overwhelm the subtle and insidious powers found in the Lovecraft myth. Keeping the same issues – the same horror – can be extremely difficult if your characters are able to change the world and the very fabric of reality.

  2. By default, Eberron knows something about magic, the moons, and so on, so the impossible secret is both less impossible and less mysterious. And that's important, because Eberron is all about magic as science, magic as technology, magic as industry. You can not research anything, design something, use something as a commodity, unless it can be reliably and quantitatively repeated and used. Lovecraftian themes absolutely do not want it. Although Eberron helps some by keeping the magic at the highest level from the hands of mortals,4 the need for reliable, predictable – D & D-like – magic to make Eberron what it will be will cause lots of problems for Lovecraftian issues.

As for your actual question, you have a small problem, as there are eleven draconian gods in this list Eberron campaign settingbut thirteen planar moons around Eberron. Dal Quor and Xoriat are prevented from getting too close to Eberron. If these are omitted, it's a bit weird as Xoriat is usually the Moon's favorite hobbyist. You could choose Dal Quor and Dolurrh instead, which is useful as these are the moons that are the most difficult to change. Dal Quor is more important in the history of Eberron than any other moon, which means that it is just more work to change it too much, and in any case, the Quori are already literal nightmare animals. Are-Lovecraftian frame.5 Dolurrh, on the other hand, is characterized by its emptiness – in Dolurrh there is nothing but gray mists and slowly dissolving souls, and this fact is very important to Eberron's themes.6

So, if we omit Dal Quor and Dolurrh, how do we assign the draconian gods to the planar moons? Well, normally they are mapped to constellations, so we have to throw that out – not a big loss, I do not think the idea for the little sidebar on page 130 is mentioned again Eberron campaign setting, Worse still, they do not really deal with elemental or orientation-based topics, as most planar moons are themed. Even a plane like Shavarath, which is about the fight – which includes good and evil, law and chaos – has no real analogue among the draconian gods. Bahamut, Falazure, Garyx, Lendy's or Tiamat could everyone makes sense of part but none of them could reasonably cover the whole thing. Io maybe for Daanvi; Knowledge and learning are often legitimate in D & D. Syriana and Thelanis, the exclusive home of angels or fairies, are particularly hard to reconcile with the draconian gods. I would probably give Thelanis Hlal and Syriana Bahamut, but it is weak.

Ultimately, I do not think the Eberron Planar Moons will serve your purposes so well. I would most likely replace all the moons in wholesale if I did this and it was not just running on Xoriat. Probably with parts of each – we need something with anti-gravity properties like Syriana for its manifestation zone to make Sharn possible, for example. I do not want to give up the Daelkyr. Dal Quor and Dolurrh are pretty important to Eberron overall. Parts of it are thus preserved. But most of the other planar moons rarely pop up and are not that important. I would probably only replace or mix them. But I also want to think long and hard about how the world of Eberron changes when Lovecraft topics are applied to the entire cosmology.


  1. Both spatial and temporal scales in Eberron are absurdly large. Realistically, they should probably be considerably smaller than they are, possibly by an order of magnitude.

  2. The people of Eberron come from the continent of Sarlona, ​​far to the east of Khorvaire. They found Khorvaire for the first time thousands of years ago, and at that time Khorvaire's civilization was confined to rather small enclaves and a lot of empty space where people could fit in. About a thousand years ago, a human king named Galifar ir'Wynarn conquered much of the continent, and his descendants completed it, only for other descendants who had not been able to break it in the last war a hundred years ago.

  3. And racism, but I digress.

  4. Humanoids mostly reach the 12th level, and even that is very, very rare. The fact that the Guardian of the Flame gains the authority of an 18th-level cleric while in the Flamekeep Cathedral is an impressive display of power, for example, because the only other spellcaster in Khorvaire is from afar so powerful, that is aroused Great pine druid, Oalian.

  5. I call Dal Quor the most influential since the quorric wars led directly to the altercation with Xen'drik, the elves' flight to Aerenal and, among other things, the creation of warforged, and then Dal Quor joined Eberron again with the Quori Conquest of Sarlona.

  6. For example, it explains the popularity of the Church of the Silver Flame and the Blood of Vol. And even more extreme cults like the Keeper, which show ways how not to go to Dolurrh.

In search of advice – discussions and help

Hello everybody!

For a while, I was looking for a funded account with a prop company. I recently started trading at challenge.fidelcrest.com (http://challenge.fidelcrest.com/). I have just completed the challenge phase. I've been told that setting up my live account will take some time – probably a few working days.

I was wondering if anyone here has any experience with this company and perhaps also has a credit balance. I should get an account with a credit of 50,000, but I'm a bit nervous. I am currently unemployed and offered a job, but I am thinking about acting full-time.

Every input is estimated.

I need some advice to install a block store

Hello, I am a relatively newcomer

I have a vps with a 50 gb ssd disk and I have bought a block memory with 1 tb

Plan is to host a WordPress site and attach the upload folder to this block store

I have 2 solutions after hours of search

1. Place the / home partition in the block store and host the entire WordPress site in block storage

2. Or create such a symlink

ln -s / data / wp-content / uploads / / home / admin / web / xxxx / public_html / wp-content / uploads /

(2. I am currently testing, but get 404 errors when I click on a link on my website.)

What do you think is the better choice?

pd: I use vestacp as control panel with centos 7 (nginx + apache)

Many thanks

Need advice when changing the hosting company

Quote Quote by rounde683
Show contribution

Do you have statistics about the geographic location of your target audience or audience? It may be useful to list what you are looking for in a host and post it here so that we can better assist you in your search.

In fact, my website is based in India and is targeted only at target groups in India.

I'm struggling with a lot of issues on my current host, such as: For example, with bugs like 403, 500, and so on, to fix issues by email. For all my problems, they only have one answer to upgrade to VPS. And now it has become impossible to reach her.

I also ran a thread here earlier where the majority of people said I probably would not exceed my resources with the above traffic and suggested switching hosts.

I hope for fewer such problems with new hosts and better support.

Looking for colocation & advice in Los Angeles

Hello, I'm looking for colocation in Los Angeles and some general advice.

I run a business by running a gameserver and selling microtransactions. Currently I rent a server for ~ 150 / month with an i7 6700k, 48GB RAM and two 1TB SSDs. I think it comes with 10 TB black and white. The problem is that either the host or the DC causes problems that lead to downtime due to DDoS attacks. I've also been told that we are "always on guard", however, every time we receive a DDoS attack and when one ends, there are a few seconds in which everyone loses the connection. I've rounded this up so it's not always on and the damage control is turned on and off. I decided to build my own server and place it somewhere near my Los Angeles home. I'm aware that I can ship the server somewhere, but for some reason, I feel safer when he's around and I can access it. I would take a server with me for the first time and not rent it. I spent about 6 hours getting in touch with data centers and getting pricing information. I also searched here for a few hours and did not find exactly what I was looking for.

What I think I need:
Over 10 TB b / w (we currently use ~ 20 TB / m)
Gigabit connection
/ 28 IPv4
1U
* Somewhere * in Los Angeles / 2 hours drive from downtown LA
Constant DDoS protection (always-on) of at least 10 gbit / s

Here are the specifications of my server:
pcpartpicker.com/list/ktYBQZ

The drives are placeholders for WD Ultrastar 4TB, the NIC is a placeholder for the Aquantia Aqtion Pro, the cooler is a placeholder for one of the Dynatron coolers, and the Chasis is SUPERMICRO CSE-813MTQ-600CB
My host said that they are moving to a new location that should solve my problems in about a week. Should I wait and trust them? You are a small company. I'm not sure if it's a good idea to save all my data to a company that may not be available next month.

The biggest problem I have is with the power. Why are all 1U rooms only delivered with ~ 200 watts of power?! There are also crazy expensive upgrades that just do not make sense. I try to do it all for ~ 150 / m. The main thing is, why can not I find something that suits the price of my property if I do not even lend hardware, just a place for the server? Do you have recommendations? Currently, Quadranet looks good, with the exception of pricing at additional power. I understand that Los Angeles costs more than other places.

General instructions and instructions are welcome. <3