vjunior wrote:
guys, hello...
I am learning here how how the JTable works...
I made below SQL:
select tx_iata as tx_iata, tx_aeroporto as tx_aeroporto, tx_cidade as tx_cidade, CONCAT('<a href="ViewLog?cidade=', tx_cidade, '">', tx_cidade, '</a>') AS Cidade from tm_aeroporto a, tm_cidade b
where a.id_cidade=b.id_cidade
I can see the data like we can check in: logbook.hangus.com.br/outro/aeroportos.html
but...
how to change Cidade field (last field) to clickable link?
thanks in advance
Why even have the red parts? They don't add anything to the SQL statement. Get rid of them. Also, consider to start having SQL keywords in uppercase. Also add some whitespace.
Code: |
SELECT tx_iata, tx_aeroporto, tx_cidade, CONCAT('<a href="ViewLog?cidade=', tx_cidade, '">', tx_cidade, '</a>') AS Cidade
FROM tm_aeroporto a, tm_cidade b
WHERE a.id_cidade=b.id_cidade;
|
From what I can tell, your SQL statement should execute. (You can always access your database directly using phpMyAdmin and then test the SQL statement for errors. Click the "inline" link when a the Browse tab for your table. Copy the SQL into the textbox. Remember to remove the existing command that is there.)
Also, with the power of ARI Data table, you don't need to have CONCAT command. You can make your SQL command to be, in the
SQL Query textbox::
Code: |
SELECT tx_iata, tx_aeroporto, tx_cidade, tx_cidade
FROM tm_aeroporto a, tm_cidade b
WHERE a.id_cidade=b.id_cidade;
|
And then in the
Columns Settings area, look for the column you entered called
tx_cidade. Scroll over to the
Format textbox, enter:
<a href="
www.domain.com/path/file.php?ViewLog={$value}">{$value}</a>
Verify the value in green for your situation.