Advertisement
Guest User

Untitled

a guest
May 29th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. // Connect to the mysql database
  3. mysql_connect("host", "username", "password");
  4.  
  5. // Select the database
  6. mysql_select_db("database");
  7.  
  8. // Run the mysql query into a variable
  9. $query = mysql_query("SELECT * FROM blah ORDER BY date DESC");
  10.  
  11. // Run a loop on each row from the query. $row is an array of columns of a row
  12. while($row = mysql_fetch_assoc($query))
  13. {
  14. // Print out the array so you can see the shit in it.
  15. print_r($row);
  16.  
  17. // You can also show data by echoing just the column name of the row like so:
  18. echo $row['column'];
  19. }
  20.  
  21. // lol end love from Fishcake. Love you Nicko <3
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement