App and mysql conection

Hello
I have created my app connected to a database in mysql, I have managed to create users and then I have logged in. In addition, each user is assigned a letter, the A for administrators and the U for users. How can I make that if you access an admit you s ee everything in the menu and if you access a user see only some sections.

Thank you

Huberto,
What you describe is not enough information to help you.
Could you please tell more about the structure of the database and, even more important, show relevant blocks of your app (right click on the block you want to show and choose download as png).
Cheers

Hi.

thanks for answering. I explain to you:

I have created a small app with inventor app and Msql. I create users and then log in, I have also created the database where there is a column in the table in which only the administrator "A" and the user "U" are put. In the mCampo(5).aia (2.0 MB) enu I can't get administrators to see some menu options that users see.

Then I want the app to register data and appear in the database as user 1 has added this data ...

Thank you

PHP:

<?php
// Juan Antonio Villalpando.
// KIO4.COM
error_reporting(E_ALL ^ E_NOTICE);
$datos=$_POST;

$Nombre=$datos['Nombre'];
$Clave=$datos['Clave'];
$Correo=$datos['Correo'];
$ROLL=$datos['ROLL'];
if (isset($Nombre) ) {

///////////////////////////////// CORREO //////////////////////////////// 

//$asunto = "Entrada en la aplicaci?n de App Campo";
//$mensaje = "Bienvenido a nuestra aplicaci?n, Nombre= ".$Nombre." y Clave= ".$Clave;

//$decorreo="hchabot@hchabot.com";
//if (mail($Correo, $asunto, $mensaje, $decorreo))
//if (mail($Correo, $asunto, $mensaje, "From: $Nombre <$decorreo>"))
//{
//echo("Mensaje enviado. ");
//}
//else
//{
//echo("Error en el envio!...");
//}

///////////////////////////////// FIN DE CORREO ///////////////////////////////

///////////////////////// INSERCI?N EN LA BASE DE DATOS DE NOMBRE Y CLAVE ///////////////////////////////


// 1.- IDENTIFICACION nombre de la base, del usuario, clave y servidor
$db_host="localhost";
$db_name="*****"; 
$db_login="*****"; 
$db_pswd="*****"; 

// 2.- CONEXION A LA BASE DE DATOS
$link = new mysqli($db_host, $db_login, $db_pswd, $db_name);


// 3.- FECHA DE ALTA
date_default_timezone_set('Europe/Madrid'); // Fecha del pa?s
setlocale(LC_ALL,'es_ES');
$zone=3600*2 ;
$fechahora=gmdate("j/m/y H:i:s", time() + $zone); 

// 4.- TOMAR LA IP DEL USUARIO
if (getenv("HTTP_X_FORWARDED_FOR")) {
$TuIP = getenv("HTTP_X_FORWARDED_FOR");
} else {
$TuIP = getenv("REMOTE_ADDR");
}

// 5.- INSERCI?N DE DATOS
$query="INSERT INTO usuarios_datos (nombre, clave, Correo, fechahora, ip, ROLL) VALUES ('$Nombre', '$Clave', '$Correo', '$fechahora','$TuIP', '$ROLL')";
mysqli_query ($link, $query);

echo "Datos agregados a la base.";

mysqli_close($link);

}

?>

PHP2:

<?php
// Juan Antonio Villalpando.
// KIO4.COM
error_reporting(E_ALL ^ E_NOTICE);

// 1.- IDENTIFICACION nombre de la base, del usuario, clave y servidor
$db_host="localhost";
$db_name="hchabot_app"; 
$db_login="hchabot_app"; 
$db_pswd="jabali1979"; 

// 2.- CONEXION A LA BASE DE DATOS
$link = new mysqli($db_host, $db_login, $db_pswd, $db_name);

// 3.- COMPROBAR SI EXISTE ESA PAREJA DE NOMBRE - CLAVE
$datos=$_GET;

$Nombre=$datos['Nombre'];
$Clave=$datos['Clave'];
////////////////////////////// CONSULTAR /////////////////////////////////////
// Juan Antonio Villalpando.
// KIO4.COM

$res=mysqli_query($link, "SELECT nombre,clave FROM `usuarios_datos` WHERE `nombre`='$Nombre' AND `clave`='$Clave' ");

$row=mysqli_fetch_array($res);

$count = mysqli_num_rows($res);
if( $count >= 1 ) { // Si hay 1 o m?s Juan - 1234, es que el usuario y clave existen.
echo 'REGISTRADO';
} else {
echo 'NO EXISTE';
}

mysqli_close($link);

?>

i'm stuck at this point

Hello Huberto

Could you code the Button Click Event (Configuracion)? i.e. check a List of Administrators. If the User is an Admin, continue to the Database, if not, pop-up a Notification.

How many Administrators are there? If only one or two, you could compile two versions of the App, one for Admin, one for Users.

Hello

I have tried something easier. How do you create a column in the database where you put user or admin U or A I have decided that if you are an admin there will be a screen and if you are a user another screen.

but I can't do it, because when I make the query to the DB, an unregistered user responds.

Hi Hubert

I don't know, it's not in my sphere of expertise. What we really need is input from TimAI2, he knows a lot about databases and give the best advice. Seems he is away at the moment though.

you are using the php script from @Juan_Antonio... probably he is able to help?
Taifun

When a user logs in, get the ROLL field, if it is "A" get Screen_A, if it is "U" get Screen_U.

You can also have only one screen and depending on whether you get "A" or "U" make the desired components visible-true or visible-false.