daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $mysql_host = "localhost";
  3. $mysql_user = "имя администратора";
  4. $mysql_password = "пароль";
  5. $mysql_database = "имя БД";
  6.  
  7.  
  8. mysql_connect($mysql_host, $mysql_user, $mysql_password);
  9. mysql_select_db($mysql_database);
  10. mysql_set_charset('utf8');
  11.  
  12. $q=mysql_query("SELECT * FROM /*Тут имя таблицы*/ /*ORDER BY ID DESC это позволяет выводить не с 1-й записи, а с последней, удали если не надо */");
  13.  
  14. while($e=mysql_fetch_assoc($q)) $output[]=$e; print(json_encode($output));
  15. ?>
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