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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:58:04+00:00 2026-06-15T03:58:04+00:00

Im new to PHP, and even newer to PHP with MS SQL, not MySQL.

  • 0

Im new to PHP, and even newer to PHP with MS SQL, not MySQL. After doing some research, I came up with what could be considered a pagination query to use, but obviously I’m going wrong somewhere because it throws an error. And I don’t understand why.

Heres the Query:

SELECT TOP 10 * FROM Products WHERE SubCatID = '".$scid."' and ProductID NOT IN ( SELECT TOP 0 * FROM Products ORDER BY ProductID ASC ) ORDER BY ProductID ASC

Heres the error:

Warning: mssql_query() [function.mssql-query]: message: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. (severity 16)

I understand it’s because of the sub-query, but can anyone just point me in the correct direction please?

  • 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-15T03:58:06+00:00Added an answer on June 15, 2026 at 3:58 am

    You must select only one column inside the subquery. Example

    SELECT TOP 10 * FROM Products WHERE SubCatID = '".$scid."' and ProductID NOT IN ( SELECT TOP 0 ProductID FROM Products ORDER BY ProductID ASC ) ORDER BY ProductID ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am still new to PHP, and even newer to Drupal's Form API. I'm
I am new to php, just got stuck with something could be even simple...
Right, I'm still new to PHP/MySQL and what I've got, even in my head,
I am new at PHP and even newer with PHP Sessions, but have been
I am new in codeigniter, even in PHP. I want to upload a zipped
I am trying to use a PHP form (new.php) to update 2 MySQL tables
New to PHP and MySQL, have heard amazing things about this website from Leo
First of all, I am still very new to PHP / mySQL so excuse
I am somewhat new to MySQL (come from MS SQL) and have recently come
New to Jquery, even newer to Jquery Ajax calls - here is my problem:

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.