SHARE
TWEET

Untitled

a guest Jan 20th, 2017 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.  
  4.         $user='root';
  5.         $pass = '';
  6.         $db='projektydb';
  7.  
  8.     if ( !( $database = mysql_connect( "localhost",
  9.             $user, $pass) ) )                      
  10.             die( "Could not connect to database </body></html>" );
  11.     if ( !mysql_select_db(  $db, $database ) )
  12.             die( "Could not open products database </body></html>" );
  13.     else{
  14.         $sql = mysql_query("SELECT * FROM projects");
  15.        
  16.         $projects = $sql;
  17.         $arr = array();
  18.        
  19.     while($row = mysql_fetch_array($projects)) {
  20.         $arr[] = $row; 
  21.        
  22.            
  23. }
  24. echo $json_response = json_encode($arr);
  25.         }
  26. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top