J'essaie de mettre GROUP comme concat dans mon PHP-Firebird. Mais ça ne marche pas. mon script comme:GROUP BY ne fonctionne pas pendant la concat
$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.";";
comment puis-je faire pour résoudre ce problème? avez-vous des sites ou un tutoriel sur PHP-CONCATENATION que je peux apprendre plus complètement? merci d'avance.
$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);
}
Pouvez-vous nous montrer à quoi ressemblent $ sWhere et $ sOrder? Votre SQL devrait fonctionner correctement en supposant qu'il y ait des espaces sur les bords des variables comme $ sGroupBy a – pinkfloydx33
ups..sorry je suis en retard – klox
Quel est le $ sLimit? –