The problem lies with me when I want to call it by the name of "alias + column" from PHP.
$sqlPersonaje = 'SELECT p.nombre,
p.nivel,
p.fuerza,
p.destreza,
p.vitalidad,
p.inteligencia,
p.agilidad,
p.suerte,
cl.nombre
FROM personaje p
INNER JOIN clase cl ON cl.ID_Clase = p.ID_Clase';
$respuestaPersonaje = mysqli_query($conn,$sqlPersonaje);
$personaje = mysqli_fetch_assoc($respuestaPersonaje);
mysqli_close($conn);
<li>Nombre: <span id="nombre"><?php echo $personaje['nombre'];?></span></li>
<li>Clase: <span id="clase"><?php echo $personaje['nombre']; ?></span></li>
If I put the character name "$ character ['p.name']" it returns an error, if I put "$ character ['name']" it returns the name of the class to which it belongs (Note that it returns the last field with the same name).
I pass the error that returns me, but I doubt it serves as something, since the rest of the values are returned to me in a perfect way, I would like to know how to be more exact when defining what I want to return to me PHP :
Notice: Undefined index: p.name in B: \ xampp \ htdocs \ Game \ app \ module \ game \ character.php on line 29
If anyone knows how to do in these cases I would appreciate it too much. I hope the question was clear.
Delete the previous post because I had made a mistake in the query, sorry!