INSERÇÃO DE DADOS GRAFICO PIE CHART GOOGLE PHP MYSQL

Boa Noite !!! Sou iniciante no PHP

Preciso exibir os resultados de uma enquete num grafico pie (pizza) no php usando o google charts, eu até agora consegui exibir o total de respostas de cada linha da enquete, porem não estou conseguindo exibir o texto das alternativas de cada pergunta

conseguem me ajudar ?

Esse é meu código:

mysqli_select_db($con, $sql(“db”));
$dados = mysqli_query($con,”SELECT DISTINCT tblquestoes.textoQuestao as quest, qt1+qt2+qt3+qt4+qt5 as teste,tblquestoes.textoAlternativa1 as txt1, tblquestoes.textoAlternativa2 as txt2,tblquestoes.textoAlternativa3 as txt3,tblquestoes.textoAlternativa4 as txt4,tblquestoes.textoAlternativa5 as txt5 FROM
(tblenquetes INNER JOIN tblquestoes ON tblenquetes.codigoenquete = tblquestoes.codigoenquete)
INNER JOIN tblrespostas
ON (tblrespostas.codigoquestao = tblquestoes.codigoquestao AND tblrespostas.codigoenquete = tblenquetes.codigoenquete);”
);
$linha = mysqli_fetch_assoc($dados);
$total = mysqli_num_rows($dados);
?>

google.charts.load(‘current’, {‘packages’:(‘corechart’)});
google.charts.setOnLoadCallback(drawChart);
google.charts.setOnLoadCallback(drawChart2);
google.charts.setOnLoadCallback(drawChart3);
google.charts.setOnLoadCallback(drawChart4);
google.charts.setOnLoadCallback(drawChart5);

  function drawChart() {

    var data = google.visualization.arrayToDataTable((
      ('Quest',   'txt1', 'txt2', 'txt3', 'txt4', 'txt5'),
      ('<?=$linha('txt1')?>', 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,  
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,),

      ('<?=$linha('txt2')?>', 
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,  
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,),

      ('<?=$linha('txt3')?>', 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao =1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,  
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,),

      ('<?=$linha('txt4')?>', 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,  
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,),

      ('<?=$linha('txt5')?>', 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,  
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>, 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 1;";
        $r = mysqli_query($conexao, $Q);
        while ($dado1 = mysqli_fetch_assoc($r)){
        echo $dado1("perc");}
        ?>,)

    )); 
    

    var options = {
      title: '<?=$linha('quest')?>',
        is3D: true,

    };

    var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));

    chart.draw(data, options);
      
  }
    
    //grafico2
    
    
    function drawChart2() {
    var data2 = google.visualization.arrayToDataTable((
      ('Questoes',   'Opção 1', 'Opção 2', 'Opção 3', 'Opção 4', 'Opção 5'),
      ('<?=$linha('txt1')?>', 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,  
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,
      <?php $Q = "SELECT qt1 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,),

      ('<?=$linha('txt2')?>', 
       <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,  
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,
      <?php $Q = "SELECT qt2 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,),

      ('<?=$linha('txt3')?>', 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,  
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,
      <?php $Q = "SELECT qt3 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,),

      ('<?=$linha('txt4')?>', 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,  
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,
      <?php $Q = "SELECT qt4 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,),
        
      ('<?=$linha('txt5')?>', 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,  
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>, 
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,
      <?php $Q = "SELECT qt5 as perc FROM tblrespostas WHERE codigoEnquete = 1 AND codigoQuestao = 2;";
        $r = mysqli_query($conexao, $Q);
        while ($dado2 = mysqli_fetch_assoc($r)){
        echo $dado2("perc");}
        ?>,),
        
    )); 

        
    var options2 = {
      title: '<?=$linha('quest')?>',
      is3D: true,
    };

o meu banco de dados esta da seguinte forma, se for ajudar

tblquestoes

tblrespostas