Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8106609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:31:04+00:00 2026-06-06T00:31:04+00:00

Here’s my query SELECT * FROM wp_postmeta WHERE meta_value LIKE ‘.$_POST[‘username’].’ AND meta_value LIKE

  • 0

Here’s my query

SELECT * FROM wp_postmeta WHERE meta_value LIKE '".$_POST['username']."' AND meta_value LIKE '".$_POST['password']."'

The thing is that the meta_value username and the meta_value password are in 2 different rows. I need to make a query that will look for both and tell me if the vars that I look for are in those rows. So I would like the result to return 1 with a simple

mysql_num_rows();

I know this is silly and should be on the same rows with different columns but I need to work with that stupid wordpress plugins who’s doing it like it want.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:31:06+00:00Added an answer on June 6, 2026 at 12:31 am

    You can use the HAVING clause in conjunction with GROUP BY to retrieve rows satisfying ALL conditions that happen across multiple rows rather than columns:

    SELECT
        *
    FROM
        wp_postmeta
    WHERE
        meta_value IN ('$filtered_username','$filtered_password')
    GROUP BY
        meta_id
    HAVING
        COUNT(*) = 2
    

    Do not insert $_POST values into the query directly, that is an open call for SQL injection attacks. Because you are using the deprecated mysql_* functions: at the bare minimum, run your $_POST variables through mysql_real_escape_string(). But best to use PDO and its support for prepared statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY
Here's a coding problem for those that like this kind of thing. Let's see
Here is the issue I am having: I have a large query that needs
Here's my code: string strSQL = SELECT * from tMedia where SKU = '
Here is a complete example. I want to forbid using A::set from objects casted
Here's the deal: I'm in the process of planning a mid-sized business application that
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here's an example query: DECLARE @table table (loc varchar(10)) INSERT INTO @table VALUES ('134a'),
Here is the problem that I am trying to solve. I have two folders

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.