Server side with SSP::complex
Server side with SSP::complex
![taouk](https://secure.gravatar.com/avatar/52024c953c1b0a526498c137f638b7c0/?default=https%3A%2F%2Fvanillicon.com%2F52024c953c1b0a526498c137f638b7c0_200.png&rating=g&size=120)
Description of problem:
I tried complex method with SSP class and i was getting
"DataTables warning: table id=example - An SQL error occurred: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens"
I finally solve this by changing the method code.
Instead of the original lines:
$resTotalLength = self::sql_exec($db, $bindings,
"SELECT COUNT({$primaryKey}
)
FROM $table
" .
$whereAllSql
);
$recordsTotal = $resTotalLength[0][0]
It work with the syntax of simple method:
$resTotalLength = self::sql_exec($db,
"SELECT COUNT({$primaryKey}
)
FROM $table
"
);
$recordsTotal = $resTotalLength[0][0];
(without $whereAllSql)
Its OK for me. I can use it in my project, but i wonder if i am missing something
My call is
ech o json_encode(
MY_SSP::complex( $_GET, $sql_connection, $table, $primaryKey, $columns, $whereResult="", "school_id = '$user_id'" )
);
Where school_id is table column
Replies
Hi,
Could you try this version of the SSP class please?
That should hopefully resolve the error.
Allan
Esa version de SSP class si funciona, gracias
"I just have to express my immense gratitude for the latest version of ssp.class.php. It's been a game-changer! After struggling for two days with the older version, I was at my wit's end with those errors. But this new version? It's like a breath of fresh air! Thank you for saving me from that headache and making my coding life so much smoother!"
Thank you once again...