Edition lookup

Hi Vitor,

In WHERE:
how can I do to make the condition highlighted?

SELECT id_utente, sc_concat(nome, ’ ',cognome, ’ ',stabilimento)
FROM utenti
WHERE utenti.livello=4 and utenti.bu_id=$_SESSION[‘var_buid’]
ORDER BY cognome, nome, stabilimento

In this way, returns error

many thanks
Fabrizio

Re: Edition lookup

SELECT id_utente, sc_concat(nome, ’ ',cognome, ’ ',stabilimento)
FROM utenti
WHERE utenti.livello=4 AND utenti.bu_id = [var_buid]
ORDER BY cognome, nome, stabilimento

Re: Edition lookup

Hi,
I changed as you suggested, but returns the following error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:xampphtdocsarillaform_esiti_linkform_esiti_link_apl.php on line 1465

Line 1465:
$nm_comando = “SELECT id_utente, nome + ’ ’ + cognome + ’ ’ + stabilimento FROM utenti WHERE utenti.livello=4 and AND utenti.bu_id = " . $_SESSION[‘var_buid’] . " ORDER BY cognome, nome, stabilimento”;

I can not understand how I do.
Thanks in advance for your help

Fabrizio

Re: Edition lookup

If utenti.bu_id is a string, you must use AND utenti.bu_id = ‘[var_buid]’

Re: Edition lookup

Hi,

same error

utenti.bu_id - integer

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:xampphtdocsarillaform_esiti_linkform_esiti_link_apl.php on line 1465

line 1465
$nm_comando = “SELECT id_utente, nome + ’ ’ + cognome + ’ ’ + stabilimento FROM utenti WHERE utenti.livello=4 and AND utenti.bu_id = '” . $_SESSION[‘var_buid’] . “’ ORDER BY cognome, nome, stabilimento”;

how can I solve?

thanks
Fabrizio

Re: Edition lookup

hello any help?

thanks!!

Re: Edition lookup

Don’t use sc_concat there. Use the concat function of the used database.