[Solved] To limit the size of the calc element

georgie

Member
Hi

I use a calc element to display informations dynamically, perfect!
But sometimes this information are so long in size that my forms bug.

I use a CSS "overflow" in lists, it is OK. But not in forms.
I have tried to apply a SQL limit in my query ("limit 0,5", in the code of the calc element), but I can not.

Can you help me?

Here my calc code:
Code:
// Declaration de la variable stockant l id d'origine
$customer_email = '{customer___email_raw}';

// if-else de gestion des cas vides - pour eviter de declencer une requete WHERE vide
if (!empty($customer_email)) {

// Acces a la base de donnees
$myDb = FabrikWorker::getDbo(false, 1);

// Creation requete - argument true pour nettoyer une eventuelle ancienne requete
$myQuery = $myDb->getQuery(true);

// Requete de recuperation de la valeur concernee en fonction de l id d'origine
$myQuery->select("group_concat(concat('<a href=\"',joo_acymailing_url.url,'\" target=\"_blank\">',date_format(from_unixtime(joo_acymailing_urlclick.date),'%d/%m/%Y'),'</a>') order by joo_acymailing_urlclick.date desc)")

->from('joo_acymailing_url inner join joo_acymailing_urlclick on joo_acymailing_url.urlid = joo_acymailing_urlclick.urlid inner join joo_acymailing_subscriber on joo_acymailing_urlclick.subid = joo_acymailing_subscriber.subid')

->where('joo_acymailing_subscriber.email = ' . $myDb->quote($customer_email));


$myDb->setQuery($myQuery);
$ClicHistory = $myDb->loadResult();

// Calcul
return $ClicHistory ;
}

// If empty
else {
return '';
}

THX
 
Hi

It seems I can not use a "setLimit" , maybe because sub-queries... It does not work.

I think it is when my calc element display manys links, it is very strange. You can see it here for example:
https://euromedicom.org/emc-v2/form/226/52608

With "fabrik_9854rtgyhjFGHJ" in ID and PWD.

Please look the field "Clics history", Its links go over the rest of the page.
 
I can't see it in your custom_css.php

Better remove the access infos from your post.
 
No, because the rest of the page above contain link, try to fill a field above for example (please do not save).
 
The MySQL limit clause applies to the final result set, not the number of rows used to construct the group concat. Your query only returns one row.

You'll have to use a sub query with a limit, and an outer query that applies the group concat to those results.


Sent from my HTC 10 using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top