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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:46:18+00:00 2026-05-16T10:46:18+00:00

dear all, i’ll take some data from the database. and join two tables.the code

  • 0

dear all, i’ll take some data from the database.
and join two tables.the code like:

SELECT DATE(A.Inspection_datetime) AS Date, 
  A.Model, 
  COUNT(A.Serial_number) AS Qty, 
  B.Name 
FROM inspection_report AS A 
LEFT JOIN Employee AS B ON A.NIK = B.NIK 
 GROUP BY A.Model, A.Serial_number

i want show this data using jQuery dataTable.I have tried to modify at dataTable’s server side script.I have changed at this part:

$sWhere = " WHERE Inspection_datetime LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' 
  OR Model LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' 
  OR Serial_number LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' 
  OR NIK LIKE '%".mysql_real_escape_string( $_POST['sSearch'] )."%' ";

$sQuery = "SELECT id, 
  DATE(A.Inspection_datetime) AS Date, 
  A.Model, 
  COUNT(A.Serial_number) AS Qty, 
  B.Name 
  FROM inspection_report AS A 
  LEFT JOIN Employee AS B ON A.NIK = B.NIK .$sWhere.$sOrder.$sLimit";

$sOutput .= "[";
  $sOutput .= '"'.addslashes($aRow['id']).'",';
  $sOutput .= '"'.addslashes($aRow['Date']).'",';
  $sOutput .= '"'.addslashes($aRow['Model']).'",';
  $sOutput .= '"'.addslashes($aRow['Qty']).'",';
  $sOutput .= '"'.addslashes($aRow['Name']).'"';
  $sOutput .= "],";

i want the result like my mysql code, but this make like:

{"sEcho":1,"iTotalRecords":2,"iTotalDisplayRecords":2, "aaData":[["42","","bar","","Steve"]]}
  • 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-16T10:46:19+00:00Added an answer on May 16, 2026 at 10:46 am

    what have I done? I was very careless. these are to be replaced.

    $sOutput .= "[";
                    $sOutput .= '"'.addslashes($aRow['id']).'",';
                    $sOutput .= '"'.addslashes($aRow['Date').'",';
                    $sOutput .= '"'.addslashes($aRow['Model']).'",';
                    $sOutput .= '"'.addslashes($aRow['Qty']).'",';
                    $sOutput .= '"'.addslashes($aRow['Name']).'"';
                    $sOutput .= "],";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear all, i want to show some data in one row from 1 column
dear All. I'm using integer PKs in some tables of mysql database. Before input
Dear all. I need to keep some temporary information in code. When i access
Dear all, I have a data frame which comes directly from a sensor. The
dear all..i have some data at DB. name Range bla 123x9901-123x0000 //it means range
dear all. i have a lot of data in my database. after that i
Dear all, I have a select query that currently produces the following results: DoctorName
Dear all expert i had a problem for comparing my string from document.write with
dear all..i've a textfield, it using barcode scanner for input data..after scan it shows
dear all..i have this code: <script> var str=KD-R435MUN2D; var matches=str.match(/(EE|[EJU]).*(D)/i); if (matches) { var

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.