Created
July 16, 2020 15:53
-
-
Save morganestes/25b881ca3d87f768573ee72701ccaf7e to your computer and use it in GitHub Desktop.
Compare post content in WordPress with MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using the "Bind parameters" option gives you two input fields to enter the post IDs. | |
SET @p1 = (SELECT `post_content` FROM `wp_posts` WHERE `ID`=:post_id1); | |
SET @p2 = (SELECT `post_content` FROM `wp_posts` WHERE `ID`=:post_id2); | |
# https://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html | |
SELECT STRCMP(@p1,@p2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment