I'm creating an android app, where when run it asks login and the user
The android checks login and password in a web service done in php
until all is well, everything is running right .. but when I ask the database to perform a select in php in web service again it returns me all and not just the logged-in user.
I believe that when I do the login verification I have to store the company code via (session) and use the same in the other page of php so when I use select with the session it only returns me the data of the user
PHP code
<php
SESSION_START();
mysql_connect('localhost','','');
mysql_select_db('bd') or die (mysql_error());
$username = $_GET['a'];
$password = $_GET['d'];
$result = mysql_query("SELECT * FROM Tab_Config where Login='$username' and Senha='$password'");
$row = mysql_fetch_assoc($result);
if(mysql_num_rows($result)>0)
{
echo $row['Cod_Empresa'];
$_SESSION['Cod_Empresa'] = $row['Cod_Empresa'];
}
else{
echo "";
}
mysql_close();
?>