Advertisement
Guest User

Untitled

a guest
Mar 6th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2.  
  3. $username = "root";
  4. $password = "";
  5. $hostname = "localhost";
  6.  
  7. //connection to the database
  8. $dbhandle = mysql_connect($hostname, $username, $password)
  9. or die("Unable to connect to MySQL");
  10.  
  11.  
  12. $selected = mysql_select_db("socyo",$dbhandle)
  13. or die("Could not select nothing");
  14.  
  15. $query="SELECT * FROM utente";
  16. $sql=mysql_query($query);
  17. $count=mysql_num_rows($sql);
  18. $array=array();
  19. for($i=0;$i<$count;$i++){
  20. $array[$i]=mysql_fetch_assoc($sql);
  21. ?>
  22. <section id="section-<?=$array[$i]['id']?>">
  23. <div class="mediabox">
  24.  
  25. <h3><?=$array[$i]['titolo']?></h3>
  26. <p><?=$array[$i]['desc']?><p>
  27. </div>
  28. </section>
  29. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement