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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:36:12+00:00 2026-05-24T16:36:12+00:00

My query is throwing up this error. Can anyone see why? $query = SELECT

  • 0

My query is throwing up this error. Can anyone see why?

$query = "SELECT * FROM Units WHERE ID = `$uniqueUnits[a]`";

Unknown column ” in ‘where clause’

  • 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-05-24T16:36:13+00:00Added an answer on May 24, 2026 at 4:36 pm

    Two problems.

    • You’re using backticks to delimit a string. Backticks delimit fields, so MySQL thinks you’re trying to give it a column name.

    • The error message indicates that, in fact, this value that it thinks is a column name, is empty. So your value $uniqueUnits[a] is probably broken, or not being interpolated correctly.


    You should do the following:

    • Interpolate your variables explictly with the “complex syntax” to be sure that the string forms properly;

    • Check the value of $query so that you can see what’s going on:

      print $query;
      
    • Use actual quotation marks to delimit strings:

      $query = "SELECT * FROM Units WHERE ID = '{$uniqueUnits[a]}'";
      //                                       ^ quote
      //                                        ^ PHP variable interpolation
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My query is throwing an error like select id,cHospital from med_patient where cHospital is
im tearing my hair out over this one. A query is throwing an error:
I'm doing a simple preparedstatement query execution and its throwing me this error: java.sql.SQLException:
i was getting this error com.ibm.db2.jcc.b.SqlException: Invalid argument: unknown column name COL1 when trying
UPDATE .$tablename. SET stock=%s WHERE itemname=.$itemname. SQL Query throwing this error: You have an
Query: SELECT DISTINCT ([Equipment List].ID) AS Expr1, [Job Assignments].Job FROM [Equipment List] LEFT JOIN
This query works great: var pageObject = (from op in db.ObjectPermissions join pg in
Alright, PHP is throwing this error (in the log) and it's quite detrimental to
Alright, PHP is throwing this error at me (in the log) when I run
Any idea why Twitter is throwing this error? GET https://search.twitter.com/search.json?q=Middle%20Tennessee%20State%20Blue%20Raiders%20Florida%20International%20Golden%20Panthers%20win%20OR%20lose%20-rt%20-from%3Aespn&&lang=en&since=2011-02-09: 403: Sorry, your query

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.