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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:05:36+00:00 2026-05-18T08:05:36+00:00

i try to put GROUP as concat in my PHP-Firebird. But it seems not

  • 0

i try to put GROUP as concat in my PHP-Firebird. But it seems not work.
my script like:

 $sGroupBy = " GROUP BY LINE_NAME ";

 $sQuery = "SELECT ".$sLimit." LINE_NAME, MODEL_ONLY, VER_ONLY, PROD_NO, 
            LOT_SIZE, START_SERIAL, SERIAL_NO_LOW, SERIAL_NO_UP, PROD_DATE 
            FROM DOC_TO".$sWhere.$sGroupBy.$sOrder.";";

how do i do to resolve this problem?
have you some sites or tutorial about PHP-CONCATENATION that i can learn more completely?
thanks for advance.


$sOrder = " ORDER BY PROD_DATE DESC ";

$sWhere = " WHERE (LINE_NAME LIKE '".$_POST['sSearch']."%' OR
          MODEL_ONLY LIKE '%".$_POST['sSearch']."%' OR ".
          " VER_ONLY LIKE '%".$_POST['sSearch']."%' OR ".
          " LOT_SIZE LIKE '%".$_POST['sSearch']."%' OR ".
          " START_SERIAL LIKE '%".$_POST['sSearch']."%' OR ".
          " SERIAL_NO_LOW LIKE '%".$_POST['sSearch']."%' OR ".
          " SERIAL_NO_UP LIKE '%".$_POST['sSearch']."%' OR ".
          " PROD_NO LIKE '%".$_POST['sSearch']."%' OR ".
          " PROD_DATE LIKE '%".$_POST['sSearch']."%') ";
$sLimit = "";
if ( isset( $_POST['iDisplayStart'] ) )
{
  settype($iDisplayStart,'integer');
  $iDisplayStart = $_POST['iDisplayStart'];
  $iDisplayLength = $_POST['iDisplayLength'];
  $sLimit = sprintf(" FIRST %d SKIP %d ",$iDisplayLength,$iDisplayStart);
}
  • 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-18T08:05:36+00:00Added an answer on May 18, 2026 at 8:05 am

    SELECT X, Y, Z GROUP BY X makes no sense; you need to group by Y and Z as well, or use them in an aggregate function. DISTINCT also works, see postgreSQL group by different from mysql?.

    You’re also using user input directly while building a query string, which is an invitation for SQL injection. Use parameterized queries. (Escaping user input also seems to be a popular solution though I cannot figure out why.) This is assuming you’re not replacing $_POST contents with escaped strings or using magic quotes, both of which would be bad practice, but nothing as serious as an SQL injection vulnerability.

    If you think there’s something wrong with your SQL query, the first thing you should do is to print it out and examine it. As it stands, a simple sSearch input like don't could have broken your code.

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

Sidebar

Related Questions

I try to put sixteen checkbuttons into frame, placing them into four columns like:
First of all, execuse the longer question, but I will try to put it
I have this code for update: public Boolean update() { try { data.put(ContactsContract.Groups.SHOULD_SYNC, true);
I try to put some HTML link behind input text and I try to
When I try to put a value into a DATE field which is invalid,
I’m using C# and WinForms to try and put just the date from a
I have a UITableViewCell and it is UITableViewCellStyleDefault . When I try to put
just to put it out there -I really did search and try to find
I've put a WebView loading an image inside a ViewPager. When I try to
public void openReport() { try { HashMap params = new HashMap(); params.put(aapor, 19); JasperReport

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.