0
all quiet?!
See if you can help me!
From the query below (use phpMyAdmin), I only need to bring the results of "LETRAA", "LETRAT", "LETRAG" and "LETRAF" to the browser screen (via PHP), but I do not know which part of the code of the query should be changed to get the result I need.
SELECT
    tr_id,
    LENGTH(TAB.RESPOSTAS)-LENGTH(REPLACE(TAB.RESPOSTAS,'A','')) LETRAA,
    LENGTH(TAB.RESPOSTAS)-LENGTH(REPLACE(TAB.RESPOSTAS,'T','')) LETRAT,
    LENGTH(TAB.RESPOSTAS)-LENGTH(REPLACE(TAB.RESPOSTAS,'G','')) LETRAG,
    LENGTH(TAB.RESPOSTAS)-LENGTH(REPLACE(TAB.RESPOSTAS,'F','')) LETRAF
FROM (
    SELECT
        tr_id,
        concat(
        tr_1 ,tr_2 ,tr_3 ,tr_4 ,tr_5 ,tr_6 ,tr_7 ,tr_8 ,tr_9 ,tr_10,
        tr_11,tr_12,tr_13,tr_14,tr_15,tr_16,tr_17,tr_18,tr_19,tr_20,
        tr_21,tr_22,tr_23,tr_24,tr_25,tr_26,tr_27,tr_28,tr_29,tr_30,
        tr_31,tr_32,tr_33,tr_34,tr_35,tr_36,tr_37,tr_38,tr_39,tr_40,
        tr_41,tr_42,tr_43,tr_44,tr_45,tr_46,tr_47,tr_48,tr_49,tr_50,
        tr_51,tr_52,tr_53,tr_54,tr_55,tr_56,tr_57,tr_58,tr_59,tr_60,
        tr_61,tr_52,tr_63,tr_64,tr_65,tr_66,tr_67,tr_68,tr_69,tr_70,
        tr_71,tr_52,tr_73,tr_74,tr_75,tr_76,tr_77,tr_78,tr_79,tr_80,
        tr_81
        ) RESPOSTAS
    FROM
        tetra_respostas
    WHERE
        tr_id = 11
) TAB
To better understand, below is an image of the expected result:
Below, the code of the page to be displayed, but still the data is not coming from the query. So I think it’s something in the query code.
    <tr>
      <td><?php echo $row_Tetragrama['tr_id']; ?></td>
      <td><?php echo $row_Tetragrama['RESPOSTAS']; ?></td>
      <td><?php echo $row_Tetragrama['LETRAA']; ?></td>
      <td><?php echo $row_Tetragrama['LETRAT']; ?></td>
      <td><?php echo $row_Tetragrama['LETRAG']; ?></td>
      <td><?php echo $row_Tetragrama['LETRAF']; ?></td>
    </tr>
						
As you say that the result in phpMyAdmin is correct then everything suggests that the problem is not with the SQL expression, but maybe I didn’t understand your question.
– anonimo
It is... my doubt is that, although the PHP and SQL codes are running "well", the data of the columns "LETRAA", "LETRAT", "LETRAG" and "LETRAF" are not displayed in the browser.
– Myller Meireles