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

  • Home
  • SEARCH
  • 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 967145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:16:08+00:00 2026-05-16T02:16:08+00:00

Ok so this one is strange and I’m thinking there must be a problem

  • 0

Ok so this one is strange and I’m thinking there must be a problem in my sql query but I don’t see anything wrong with it. What is happening is that I have a script that I am running in a php script that retrieves all categories that a user has signed up for as well as how many other people have signed up for the same category. When I run the query in the php page it is very slow but does return results. I wanted to see what was happening so I went to phpmyadmin to run the same script and it returns the count of the results very fast but then gives me the following error where the results would normally be displayed:

#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 '' at line 1 

Here is the query:

SELECT t1.category_id, t3.description AS 'Category',
    t1.list_type_id, t2.name, t1.status_id, t2.user_id,
    t2.email, UNIX_TIMESTAMP( t1.record_date ) AS 'RecordDate',
    (
        SELECT COUNT( category_id ) 
        FROM t1_sub
        WHERE t1_sub = t1.job_ctg_id AND
            t1_sub.list_type_id = t1.list_type_id AND
            t1_sub.status_id =44
    ) AS 'MatchingListings'
FROM t1
INNER JOIN t2 ON t2.id_rfp_vendor_data = t1.user_id
INNER JOIN t3 ON t3.type_lookup_id = t1.job_ctg_id
WHERE t1.status_id =43

I am at a loss. The reason for my question is really two fold:

  1. Is there actually something wrong with my query that I am missing?
  2. If not, is the error mysql showing the reason why my script is running slow and that php has some way around this? (Though this seems like an unlikely possibility I just have to ask to be sure)

Thanks!

  • 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-16T02:16:09+00:00Added an answer on May 16, 2026 at 2:16 am

    PHPMyAdmin takes the liberty to slightly rewrite your queries (for example, adds the LIMIT 0,30 clause as to only show the first 30 lines).

    Can you enable the query-log and see which query actually gets executed on the server?

    If not, try removing elements from the query until it does work. Show us that query. Or show some table definitions?

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

Sidebar

Related Questions

This is a bit of a strange one, but I've been struggling for a
This one i had today is a strange one. I have this query in
Strange one this, which isn't programming related directly, but I thought it important to
This is a strange one to me. Let me list the setup: Application with
This is a strange one... In a windows forms app (VB.NET/VS 2005) I have
This a bit of strange one.... We have an internal web app that runs
This one has been bugging me for a while now. Is there a way
This is a strange one Take this schema: Contact: actAs: [Timestampable,SoftDelete] columns: first_name: {
This' strange because all my other NSUrls in program are working properly but this
This one seems to be quite ridiculous but how can I open a VS

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.