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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:30:28+00:00 2026-05-26T08:30:28+00:00

$threadID=$_GET[‘threadID’]; $result=mysql_query( SELECT * FROM threads AS Threads INNER JOIN users AS Users ON

  • 0
       $threadID=$_GET['threadID'];

            $result=mysql_query("
            SELECT * FROM threads AS Threads
            INNER JOIN users AS Users ON Threads.user_id=Users.user_id 
            WHERE thread_id='$threadID' LIMIT 1
            ") or die(mysql_error());

I get this:

u have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near ”11′ at
line 3

I wrote many inner joins before. Why is my syntax wrong near the end of the query

updated: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’12’ LIMIT 1′ at line 3

  • 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-26T08:30:29+00:00Added an answer on May 26, 2026 at 8:30 am

    First of all, your query is WIDE open to sql injection attacks.

    Second, to figure out why you get the syntax error, make the query building phase separate from the actual query call:

    $sql = "SELECT ....";
    echo $sql;
    $result = mysql_query($sql) or die(...);
    

    This way you can see the entire query. MySQL’s error messages only report the portion of the query from where it thinks the error is onwards, but sometimes it decides wrong and elminates the actual relevant part where th error is… so… examine the ENTIRE query.

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

Sidebar

Related Questions

<?php $query = mysql_query(SELECT * FROM threads INNER JOIN accounts ON threads.author = accounts.id
Oi Right to the problem. SELECT *,t.id AS threadid FROM threads t LEFT JOIN
function get_tags_by_criteria($gender_id, $country_id, $region_id, $city_id, $day_of_birth=NULL, $tag_id=NULL, $thread_id=NULL) { $query = SELECT tags.* FROM
Is there a way to get a Thread's ThreadName from a ThreadId? (from say,
I am trying to query the following HQL using GORM: MailMessage.executeQuery(toId, count(toId) from (SELECT
Threads ------- ThreadID UsersID Date ThreadTitle ThreadParagraph ThreadClosed Topics ----- TopicsID Theme Topics Date
Using pthreads if there is any intelligent way to get all the threadID s
I have a windows service that spawns off around 60 threads when it starts.
From the text The Repository pattern is a Mediator between the Domain and Data
Why do I get compilation errors from the following? int[] threadIDs = { 4,5,6,7,8,9,10,11,12,13,14,15,16,17

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.