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 7930783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:32:04+00:00 2026-06-03T20:32:04+00:00

I have this $sql=mysql_query(SELECT EMAIL FROM USERNAME WHERE EMAIL <> ‘.$_REQUEST[‘EMAIL’].’ AND EMAIL NOT

  • 0

I have this

$sql=mysql_query("SELECT EMAIL FROM USERNAME WHERE EMAIL <> '".$_REQUEST['EMAIL']."' AND EMAIL NOT IN (".$str.")") or die("Error: ". mysql_error(). " with query ". $sql);

for example $str holds the value ‘d’,’f’ and there is a d and f in the EMAIL column in my table.

When I run the query I get this error “Error: Unknown column ‘d’ in ‘where clause’ with query”

I am a complete noob to mysql so I hope I’m just missing something very basic here. Any help is greatly appreciated!

  • 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-03T20:32:06+00:00Added an answer on June 3, 2026 at 8:32 pm

    Nice SQL injection hole there. Enjoy having your server pwn3d.

    The IN syntax works either as

    WHERE field IN (value1, value2, value3, ...)
    

    or

    WHERE value IN (field1, field2, field3, ...)
    

    Given you’re getting the ‘no such d, you’re probably forgetting to quote those values, producing

    WHERE field IN (d, f)
    

    which is interpeted as “field d” and “field f”, where it shoul be:

    WHERE field IN ('d', 'f')
    

    Note the quotes – they turn those d and f’s into strings, not field names.

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

Sidebar

Related Questions

I have this SQL query: SELECT * FROM IMAGES WHERE IMAGENAME in ('IMG1', 'IMG2',
I have this simple PHP code: $query = mysql_query(SELECT `title`, `url_title` FROM `fastsearch` WHERE
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
I have this sql statement: CREATE TABLE [dbo].[User]( [UserId] [int] IDENTITY(1,1) NOT NULL, [FirstName]
I have this SQL query select case when AllowanceId is null then 2 else
I have this sql query: SELECT S.SEARCH, S.STATUS, C.TITLE AS CategoryName, E.SEARCH_ENGINES AS Engine,
I have this SQL query: SELECT *, 6371.04 * acos(cos(pi() / 2 - radians(90
This is giving error. (You have an error in your SQL syntax; check the
I have this query: update sales_flat_quote set customer_email = (concat(select substring(md5(rand()) from 1 for
I currently have this statement in my SQL View (SQL Server 2008 R2) which

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.