1j0e

Untitled

May 16th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. $con = mysql_connect( "localhost","root","root" );
  4. $list = "";
  5.  
  6.  
  7. if ( !$con ){
  8.  
  9. die( 'Could not connect: ' . mysql_error() );
  10.  
  11. } else {
  12.  
  13. mysql_select_db( "lolerstream", $con );
  14.  
  15. $query = "SELECT * FROM suggestions";
  16.  
  17. $result = mysql_query( $query,$con ) or die( 'Could not execute query: ' . mysql_error() );
  18.  
  19.  
  20. while ( $row = mysql_fetch_array( $result ) ) {
  21.  
  22. $list = $list + " <div class='suggestion'> $row['submitdate'] -\t $row['contents'] </div> \n ";
  23.  
  24. }
  25.  
  26.  
  27. }
  28. mysql_close($con);
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment