Advertisement
diegodcpbr

php mostra usuario

Nov 19th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <?php
  2. include('../../config.php');
  3. $sql = MySql::conectar()->prepare('SELECT DISTINCT
  4.    `tb_site.rifas`.`titulo`, `tb_site.test`.`number`
  5. FROM
  6.    `tb_site.test`
  7. LEFT OUTER JOIN `tb_site.user` ON
  8.    (
  9.        `tb_site.user`.`id` = `tb_site.test`.`user_id`
  10.    )
  11.    INNER JOIN `tb_site.rifas` ON
  12.    (
  13.        `tb_site.rifas`.`id` = `tb_site.test`.`rifas_id`
  14.    )
  15.    
  16. WHERE
  17.    `tb_site.user`.`cpf_usuario` = 123
  18. GROUP BY
  19.    `tb_site.rifas`.`titulo`,`tb_site.test`.`number`');
  20.     //"'.$_SESSION['cpf_usuario'].'"
  21.         $sql->execute();
  22.          $rifaindex = $sql->fetchAll();
  23.          
  24.                                
  25.                                 $count=0;
  26.                                 while(list($key, $value) = each($rifaindex)) {
  27.                                     //$reservados = 1;
  28.                                    //echo $nome = 'ID '.$value['id'].'<hr>';
  29.                                     //echo $numeros = 'USUARIO ID '.$value['user_id'].'<hr>';
  30.                                     //echo $numeros = 'RIFA ID '.$value['rifas_id'].'<hr>';
  31.                                     $titulo = $value['titulo'];
  32.                                     $numeros_rifa = $value['number'];
  33.                                     echo $numeros = 'RIFA TITULO '.$titulo.' RIFA NUMEROS '.$numeros_rifa.'<br>';
  34.                                     //echo $numeros1 .= 'RIFA NUMEROS '.$value['number'].',';
  35.                             $count++;
  36.                                        
  37.                                        
  38.                    
  39. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement