Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $startTime = microtime(true);
- mysql_connect('localhost', 'php', 'php');
- mysql_select_db('php_mysqltest');
- $q = mysql_query('SELECT * FROM test');
- $result = array();
- while($row = mysql_fetch_assoc($q)) {
- $result[] = $row;
- }
- header('Content-Type: application/json');
- echo json_encode($result);
- $endTime = microtime(true);
- echo 'Query took ', $endTime - $startTime, ' seconds';
Add Comment
Please, Sign In to add comment