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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:41:27+00:00 2026-05-25T13:41:27+00:00

I wanted to write additional query to phpbb3 karma mod which checks that a

  • 0

I wanted to write additional query to phpbb3 karma mod which checks that a user can’t give karma to same person before he hasn’t given karma to 3 other persons. But i’m receiving error in my SQL syntax…

I checked this and this link and query i’ve written looks as follow

SELECT * 
FROM phpbb_karma AS out 
WHERE out.poster_id = 134
AND out.poster_id
NOT IN 
(SELECT k.karma_id, k.user_id, k.poster_id
FROM phpbb_karma AS k
WHERE user_id = 108
ORDER BY k.karma_id DESC LIMIT 3)

So my inner query gets the 3 last persons (poster_id) whom he (user_id) gave karma. This query alone works but together with my outer query it gives me error

1064 – 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 ‘out WHERE out.poster_id = 134 AND out.poster_id NOT IN (SELECT
k.karma_id, k.u’ at line 2

In my outer query i write that the person who will be receiving karma is 134 and that he must not be present in my inner query result.

What could be wrong with that query? Is the error really in second row?

I wrote the same query with LEFT JOIN, but it gives me same syntax error

SELECT *
FROM phpbb_karma AS out
LEFT JOIN phpbb_karma AS in
ON in.poster_id = out.poster_id
WHERE in.poster_id = 134 AND in.poster_id IS NULL

1064 – 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 ‘out LEFT JOIN phpbb_karma AS in ON in.poster_id = out.poster_id
WHERE in.poster_’ at line 2

MySQL version is MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $ but i don’t think that the problem is in version, because the LEFT JOIN doesn’t work either

  • 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-25T13:41:27+00:00Added an answer on May 25, 2026 at 1:41 pm

    Use a different alias, because out is a reserved keyword: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

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

Sidebar

Related Questions

I wanted to write a function that would take an object and convert it
Just wanted to write some recursion but can't check if the child is in
I wanted to write following query through codeigniter's db helper class, guide me plz
I wanted to write a method with an argument that defaults to a member
I wanted to write a Custom Control that would show a family tree... so
I wanted to write a program that test if two files are duplicates (have
Say I wanted to write a program that would export calendar data so that
UPDATE: After some additional reading, what I really wanted was guaranteed early binding (which
I'm trying to write a simple dashboard widget (possibly an additional webapp) that displays
I wanted to write an Android and/or an iPhone app that entails taking a

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.