PHP MySQL server-side processing need help.

PHP MySQL server-side processing need help.

JerrysJerrys Posts: 13Questions: 2Answers: 0
edited September 2012 in DataTables 1.9
Hello,
i'll trying to run server-side script on PHP with MySQL data base.
And when I try to make a INNER JOIN in server side script, the search option stoped worked, only showing message "Processing... " and don't get any answers.

My code is:

[code]
$aColumns = array(
'id',
'inventorinis',
'atsakingas',
'dislokacija'
);

/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";

/* DB table to use */
$sTable = "iranga";

/* Join condition */

$sJoin = "INNER JOIN auditas ON iranga.inventorinis = auditas.inventorinis";

/* Select condition */
$sSelect = "auditas.id AS id, auditas.inventorinis AS inventorinis, iranga.atsakingas AS atsakingas, iranga.dislokacija AS dislokacija";
[/code]

[code]
/*
* SQL queries
* Get data to display
*/

$sQuery = "
SELECT SQL_CALC_FOUND_ROWS $sSelect
FROM $sTable
$sJoin
$sWhere
$sOrder
$sLimit
";
[/code]


Please help me found error, why stoped working a search option in datatables, when I try use releationships between two data base tables.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sounds like an SQL issue. I'd suggest printing out the built SQL statement and debugging that.

    Allan
  • david63david63 Posts: 7Questions: 0Answers: 0
    have you looked in Firebug as it sometimes gives the php/sql error message?
This discussion has been closed.