android - php fetch mysql data by user id
<p>This my PHP URL for fetching the data from MySQL. I need to make <code>mysqli_fetch_array</code> code saying if filled <code>uid</code> in the <code>app-data</code> table is the same with <code>uid</code> in <code>users</code> table fetch the data from all row in <code>app-data</code> to the <code>uid</code> like every user show his items from <code>app-data</code> table.</p>

<pre><code>$host = "";
$user = "";
$pwd = "";
$db = ""; 

$con = mysqli_connect($host, $user, $pwd, $db);

if(mysqli_connect_errno($con)) {
    die("Failed to connect to MySQL: " . mysqli_connect_error());
} 

$sql = "SELECT * FROM app_data ORDER By id";
$result = mysqli_query($con, $sql);

$rows = array();

while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
    $rows[] = $row; 
}

mysqli_close($con);

echo json_encode($rows);
</code></pre>