Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type: text/html; charset=UTF-8");
- #header('Content-Encoding: utf-8');
- #include('csat.php');
- /* Connection vars here for example only. Consider a more secure method. */
- $dbhost = 'localhost';
- $dbuser = 'root';
- $dbpass = '';
- $dbname = 'customer';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
- mysql_select_db($dbname);
- $return_arr = array();
- /* If connection to database, run sql statement. */
- if ($conn)
- {
- $fetch = mysql_query("SELECT * FROM telepulesek where IRSZ like '%" . mysql_real_escape_string($_GET['term']) . "%'LIMIT 0,5");
- /* Retrieve and store in array the results of the query.*/
- while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) {
- $row_array['IRSZ'] = $row['IRSZ'];
- array_push($return_arr,$row_array);
- }
- }
- /* Free connection resources. */
- mysql_close($conn);
- /* Toss back results as json encoded array. */
- echo json_encode($return_arr);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement