Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $hostname="localhost";
  2. $username="myinvestpa";
  3. $password="jPd4qB06";
  4. $dbname="investpainbbdd";
  5.  
  6. $conn = mysqli_connect($hostname,$username,$password) or die ("<html><script language='JavaScript'>alert('Unable to connect to database! Please try again later.'),history.go(-1)</script></html>");
  7. mysqli_select_db($conn,$dbname);
  8.  
  9. //Realizamos la consulta sql y la ordenamos ascendiente
  10.  
  11. $query = "SELECT ID FROM wp_users ORDER BY ID ASC";
  12. $results1 = mysqli_query($conn,$query) or die('ok');
  13. $fila = mysqli_fetch_row($results1);
  14. /*Ya tenemos mlos id de los usuarios ordenados de menor a mayor y guardados en un array*/
  15.  
  16. //ahora hemos de realizar una nueva consulta para saber los id de los usuarios que han subido producto Y LO ORDENAMOS DE MENOR A MAYOR
  17.  
  18. $query2 ="SELECT post_author FROM wp_posts WHERE post_type= 'product' ORDER BY post_author ASC";
  19. $results2 = mysqli_query($conn,$query2) or die('ok');
  20. $fila2 = mysqli_fetch_row($results2);
  21. //YA TENEMOS LOS ID D ELOS USUARIOS ORDENADOS DE MAYOR A MENOR QUE HAN SUBIDO PRODUCTO
  22.  
  23. for($i=3;$i<=$fila2;$i++){
  24. if($usuario)
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement