- <?php
- require_once 'connection.php';
- $link = conenct('localhost', 'root', '', 'w_db');
- mysql_query( "SET NAMES utf8" );
- mysql_query( "SET CHARACTER SET utf8" );
- mysql_set_charset('utf8', $link);
- $id = $_POST['id'];
- $id = mysql_real_escape_string($id);
- $query = mysql_query("SELECT * FROM users WHERE id = '$id'") or die('Invalid query:'. mysql_error());
- $userInfo = mysql_fetch_assoc($query);
- echo json_encode($userInfo );
- ?>
When I am running the page no alert pops out. What is wrong with my code?!?!?