I want to enter a query in a "db read".
The query must be the user's login.
How can I do ??
thanks
The query must be the user's login.
How can I do ??
thanks
I inserted a "custom code" in the "On Load"
I tested these two codes in "conditions" of the "db read"
Unfortunately, the query does not work
<?php
$user = \JFactory::getUser();
$form->data['user_id'] = $user->username;
?>
I tested these two codes in "conditions" of the "db read"
<?php
$user = \JFactory::getUser();
return array('model id.field' => $user->username);
?>
or
<?php
$user = \JFactory::getUser();
$form->data['field'] = $user->username;
?>
Unfortunately, the query does not work
Hi agostino87 ,
Then you have something incorrect - there isn't enough information here to give me any idea what that is. If you add a Debugger after the DB Save action you can see the query that is being created.
Bob
Then you have something incorrect - there isn't enough information here to give me any idea what that is. If you add a Debugger after the DB Save action you can see the query that is being created.
Bob
Hi,
Just this code in the db read will do it:
no need for the other code of the on load, unless you use the "user_id" variable.
Best regards,
Max
Just this code in the db read will do it:
<?php
$user = \JFactory::getUser();
return array('field' => $user->username);
?>
no need for the other code of the on load, unless you use the "user_id" variable.
Best regards,
Max
i have delete custom code.
i use
debug DBread this is
I there is a doubt, there is no difference between upper and lower case in the query?
i use
<?php
$user = \JFactory::getUser();
return array('agente' => $user->username);
?>
debug DBread this is
Array
(
[24] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `elenco`.`codice` AS `elenco.codice`, `elenco`.`nomeCliente` AS `elenco.nomeCliente`, `elenco`.`codicenome` AS `elenco.codicenome`, `elenco`.`agente` AS `elenco.agente`, `elenco`.`manager` AS `elenco.manager` FROM `anagrafica` AS `elenco` WHERE `elenco`.`agente` = 'tuttoilmondo' ORDER BY `elenco`.`codicenome`
)
)
)
)
I there is a doubt, there is no difference between upper and lower case in the query?
This topic is locked and no more replies can be posted.