Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. $username = "root";
  3. $password = "";
  4. $hostname = "localhost";
  5.  
  6. //connection to the database
  7. $dbhandle = mysql_connect($hostname, $username, $password)
  8. or die("Unable to connect to MySQL");
  9. echo "Connected to MySQL<br>";
  10.  
  11. $selected = mysql_select_db("accordion",$dbhandle)
  12. or die("Could not select nueva");
  13.  
  14. $result = mysql_query("SELECT id,planta FROM nueva where id=1");
  15.  
  16. while ($row = mysql_fetch_array($result)) {
  17. echo "ID: ".$row{'id'}." "."Planta: ".$row{'planta'}."<br>";
  18. $planta=$row{'planta'};
  19. $ID=$row{"id"};
  20. }
  21.  
  22. ?>
  23.  
  24. var accordion= $("#accordions").val();
  25. var PHP_VARS = <?php echo $planta; ?>;
  26. for (var i=0; i<PHP_VARS; i++) {
  27. $(".accordion").append("<li class=tabs><div class=paragraph><h1>Accordion</h1><p>Esto es una Pruba.</p></div></li>")
  28. }
  29.  
  30. $(".accordion").click(function() {
  31. $(".tabs").css("width","300px");
  32. });
  33.  
  34. <div class="container">
  35. <ul class="accordion">
  36.  
  37.  
  38.  
  39. </ul>
  40. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement