Hello, I have created a PHP code to obtain the names of the columns of my MySQL base and I have not been able to put the names of the columns in a label in App Inventor.
I attach photos of the code itself and what I managed to show on the phone.
Hello, I have created a PHP code to obtain the names of the columns of my MySQL base and I have not been able to put the names of the columns in a label in App Inventor.
I attach photos of the code itself and what I managed to show on the phone.
Does your php code work in a browser ?
i think, i attach my code php
<?php
// Juan Antonio Villalpando
// juana1991@yahoo.com
// http://kio4.com
// 1.- IDENTIFICACION nombre de la base, del usuario, clave y servidor
require_once('conexiona.php');
// 2.- CONEXION A LA BASE DE DATOS
// mysql_select_db($db_name) or die(mysql_error());
$link = new mysqli($db_host, $db_login, $db_pswd, $db_name);
// Check connection
if ($link->connect_error) {
die('Connect Error: ' . $mysqli->connect_error);
}
mysqli_query($link, 'SET NAMES utf8');
$nombre = $_POST['nombre'];
echo $nombre;
$hacer = mysqli_query ($link, "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '$nombre'");
$resultado = mysqli_query($link, "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '$nombre'");
$numerodefilas = mysqli_num_rows($resultado);
if ($numerodefilas > 0) {
while ($rowr = mysqli_fetch_row($hacer)) {
for ($j=0;$j<$numerodefilas;$j++) {
$datos .= $rowr[$j].",";
}
}
}
echo $datos;
mysqli_close($link);
?>
a
Taifun
does not work, app inventor show me this error "Select list item: Attempt to get item number 2 of a list of length 1: ["]", and in the app show "[],usuariosusuario< br>clave< br>,
???
nop
Then how do you expect it to work in AppInventor ??? Get your php working first.
and u can help me?im newbie
Have you created your database?
Have you configured...?
$db_host="localhost";
$db_name="id1xxxxx";
$db_login="idxxxx";
$db_pswd="xxxxxx";
yes, is conexiona.php, my php work for show column name but i can't put columns name in different labels
I will explain what I want to do, I want to place for example "usuariosusuario" where it says valor 1 and clave where it says valor 2 but there are values that complicate this, such as those ","
What about adjusting the example to your needs? As you can see from the result, the example uses <br>
as column delimiter... what prevents you from replacing that by a comma as delimiter?
Taifun
What is Etiquet9, what do you get in Etiqueta9?