Finding rows that are missing specific value in a set

The database that I am using is MySQL. I have an options table that roughly looks like this

id          int(10) PRIMARY annex_id    int(10) title       varchar(255) sort_order  INT(10) NOT NULL 

Every annex (annex_id) has bunch of options enumerated by sort_order column which varies from 1 to N and are controlled by humans.

Due to software bug from a couple of months a lot of annexes do not have an option with sort_order == 1 but rather start from 2 or 3.

What I want to do is get all the annex_id‘s which contain options that do not have sort_order == 1. I’ll show an exemplary table because I feel like I’m explaining it wrong (which could be the reason I can’t come up with a query for it and I’ve been at it for hours).

ID Annex ID Title Sort Order
12 567 Title #1 1
13 567 Title #2 2
14 567 Title #3 3
15 890 Another title #1 2
16 890 Another title #2 3

From the given table I pretty much want craft a query that would get annex id 890 because it doesn’t have a row with sort order == 1.

The table has hundreds of thousands of rows and going at it by hand is insane. I’ve been dealing with databases for years and either I’m overthinking it or idk what but I can’t come up with an efficient query to do this job.

Is it even possible to have a query like this?

Missing .twig files in wordpress theme editor

I just started learning timber. Timber uses twig as its templating engine.

This is great but I have a problem with displaying all .twig files in the theme editor. I’m using VS code for my code development so I have no problem viewing and accessing .twig files there.

My problem is with the built in wordpress theme editor.

Do you know of a way to show all the file/folder structure when using the theme editor? starting with displaying .twig files but would also be nice to see all file/folder structure including, vendor, composer.json etc…

I’m missing something basic relating to broken link checker

Broken Link Checker finds these links in my page OK

<a href=”https://google.com”>Google/a>
<a href=”about-us”>About</a>

But does not list these in results – either as Online or 404 (even if eg the image does not exist)

1. <a href=”page04#topic”> 
2. src=”images/img-city02.jpg”

Both of the above show as blue hyperlinks in my browser when viewing source. When I click these links I get the valid full URL and the page or image opens
1. https://mydomain.com/page04#topic
2. https://mydomain.com/images/img-city02.jpg

I have tried an online link checker and it does return a broken link if eg the image is missing.

What have I misunderstood or what am I doing wrong?

Linked server only works if I am on the machine itself. I can’t use it from my local computer. what is missing?

I have a few queries that I use to monitor log shipping. Sometimes I want to run those queries on a different server. I usually do that through a linked server.

I have a server called SQLDEV4-TS that has a linked server to MY_SERVER\DEVELOPMENT

ON SQLDEV4-TS I have setup Kerberos as per the picture below:

enter image description here

I have this query below that I use to test the connectivity to the linked server.

DECLARE @server_name sysname = @@servername SELECT @server_name=N'MY_SERVER\DEVELOPMENT'   DECLARE @sql NVARCHAR(MAX) = N'SELECT * FROM OPENQUERY([' + @server_name +'],        ''SELECT ''''Radhe'''' AS Radhe'');'  BEGIN TRY     EXEC sp_testlinkedserver @server_name      EXEC sp_executesql @sql=@sql  END TRY BEGIN CATCH     SELECT [error_number]=ERROR_NUMBER(), [error_message]=ERROR_MESSAGE(); END CATCH;  PRINT 'We got past the Catch block!'; 

When I am on the server itself – SQLDEV4-TS – and I run the above script I get the following result:

enter image description here

All good – it works as expected – no problem.

However, when I connect to SQLDEV4-TS from my local machine, and run the script (on my machine) I get the following result:

Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.

enter image description here

What is missing in this linked server setting, that I have to be on the machine itself for it to work?

Missing Meta Keys on WooCommerce orders

I have a WPML problem with order language being ignored, and according to WPML it is because there is no meta keys in the metabox on orders. I only see attributes. Especially wpml_languages are missing.

I have a fresh install with the same theme, the same WP version and the same plugins – here I do not have this problem.

I have 3 sites from the same DB copy, one local, one for testing and one live. Everyone has this problem.

Have tried switching to a default theme, disabling all plugins, updating everything, etc. Nothing helps.

Any idea what could be causing this?

Error Code: 1822. Failed to add the foreign key constraint. Missing index for constraint ’employee_ibfk_1′ in the referenced table ‘branch’

strong text I AM GETTING THE ABOVE ERROR AFTER EXECUTING ALTER TABLE STATEMENT… I HAVE ASSIGNED THE SAME DATA TYPES for both ids’s. HOW TO RESOLVE THE ABOVE ERROR.

CREATE TABLE Employee( Emp_ID INT PRIMARY KEY, First_Name VARCHAR(25), Last_Name VARCHAR(25), Birth_Day DATE, Sex VARCHAR(1), Salary INT, Super_ID INT, Branch_ID INT );

CREATE TABLE Branch( Branch_ID INT, Branch_Name VARCHAR(40), Mgr_ID INT, Mgr_Start_Date DATE, FOREIGN KEY(Mgr_ID) REFERENCES Employee(Emp_ID) );

ALTER TABLE Employee ADD FOREIGN KEY(Branch_ID) REFERENCES Branch(Branch_ID) ON DELETE SET NULL;

Missing or invalid site address

I have a multisite with parked subdomains. The IPs on the parked domains are all set to point to the admin/main site, the DNS likewise. Two subdomains were set up last year seem to work fine. Adding two more now fail returning the error ‘Missing or invalid site address’.

The wp-config seems to be correctly set for domains and the URL seems to be correct in phpmyadmin. Disabling plugins has no effect, restoring from backup has no effect, but I haven’t been using the site for some weeks. I am the only admin. The webhost support looked into it but can’t see the problem and tell me it’s not server related (ie not their problem).

HTML Issue with Twitter Card – What We are Missing

Hi,

i added to our website code of open graph and twitter …… so if we share to social media then pictures, title, description etc are coming properly in Facebook, Linkedin but On twitter image is missing …. While image URL in code id perfect.

If i am using any tools like buffer then images are coming properly and sharing also to properly to twitter but when i am sharing from website then twitter is not showing image.

Code are as below

<meta name="twitter:card"...
Code (markup):

HTML Issue with Twitter Card – What We are Missing

Preventing a missing or faulty plugin loaded inside of wp-settings from halting a script

foreach ( wp_get_active_and_valid_plugins() as $  plugin ) {     echo $  plugin;     wp_register_plugin_realpath( $  plugin );     include_once $  plugin;      /**      * Fires once a single activated plugin has loaded.      *      * @since 5.1.0      *      * @param string $  plugin Full path to the plugin's main file.      */     do_action( 'plugin_loaded', $  plugin );     echo 'end'; } 

So I have a script that loads wp-settings and the script halts at: /var/www/public/wp-content/plugins/w3-total-cache/w3-total-cache.php. I am thinking that do_action(‘plugin_loaded’, $ plugin); throws an exception and stops the script from running, how do you prevent an exception like that from halting a script? I tried to put a try catch, but it doesn’t work.