SQL - Mayusculas/minusculas en un Select

 
Vista:
Imágen de perfil de Lucas
Val: 8
Ha disminuido su posición en 17 puestos en SQL (en relación al último mes)
Gráfica de SQL

Mayusculas/minusculas en un Select

Publicado por Lucas (5 intervenciones) el 11/05/2020 18:15:06
Alguien podría explicarme por que cuando en la instrucción SELECT de la linea 25 introduzco los campos en mayúsculas (Así como lo tengo en la base de datos) no funciona, en cambio, si lo hace cuando las escribo en minúscula con la primer letra mayúscula?

Agrego: Tampoco funciona si en vez de escribir campo por campo escribo "*"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
    session_start();
    if(!isset($_SESSION["sesion"])){
        header("Location:index.html");
    }
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CRUD</title>
<link href="formulario.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Muli&display=swap" rel="stylesheet">
<?php
  include ("conexion.php");
?>
 
</head>
<body>
<a href="menu.php"><button>Volver al menú</button></a>
<h1>Corte</h1>
 
 
<?php
$registros=$base->query("SELECT ID ,Nombre, Elemento1, Elemento2, Elemento3, Elemento4, Elemento5, Lote, Fecha FROM DATOS WHERE SECCIÓN = 'Corte' ORDER BY FECHA DESC")->fetchAll(PDO::FETCH_OBJ);
//$registros=$base->query("SELECT ID ,NOMBRE, ELEMENTO1, ELEMENTO2, ELEMENTO3, ELEMENTO4, ELEMENTO5, LOTE, FECHAFROM DATOS WHERE SECCIÓN = 'Corte' ORDER BY FECHA DESC")->fetchAll(PDO::FETCH_OBJ); ESTA LINEA NO FUNCIONA.
 
if(isset($_GET["lote"])){
  $lote=$_GET["lote"];
}else{
  $lote="";
}
if(isset($_GET["fecha"])){
  $fecha=$_GET["fecha"];
}else{
  $fecha="";
}
?>
 
 
 
<form action="envio.php?planilla=Corte" method="post">
<div class="total">
<div class="comunes">
      <div class="comun" id="fecha">
        <label for="fecha">Fecha</label>
        <input type="date" name="fecha" value="<?php echo $fecha; ?>">
      </div>
      <div class="comun" id="lote">
        <label for="lote">Lote</label>
        <input type="text" name="lote" value="<?php echo $lote;?>">
      </div>
</div>
 
<div class="tabla_planilla">
<table class="planillas">
    <tr>
      <th>Lote</th>
      <th>Fecha</th>
      <th>Nombre</th>
    </tr>
 
<?php
foreach($registros as $columna):?>
   	<tr>
      <td><?php echo $columna->Lote?></td>
      <td><?php echo $columna->Fecha?></td>
      <td><?php echo $columna->Nombre?></td>
      <td><?php echo $columna->Elemento1?></td>
      <td><?php echo $columna->Elemento2?></td>
      <td><?php echo $columna->Elemento3?></td>
      <td><?php echo $columna->Elemento4?></td>
      <td><?php echo $columna->Elemento5?></td>
 
      <td><a href="confirmar_borrar.php?id=<?php echo $columna->ID . "&lote=" . $columna->Lote . "&fecha=" . $columna->Fecha . "&nombre=" . $columna->Nombre;?>"><input type='button' name='del' id='del' value='Borrar'></a></td>
    </tr>
<?php
endforeach;
?>
</table>
</div>
<div class="tabla_insertar">
      <div class="nombre_insertar"><label for="nombre">Nombre</label><input type='text' name='nombre' autocomplete='off'></div>
    <div class="inputs_insertar">
      <label>Pesos</label>
      <input type='number' step='0.01' name='elemento1'>
      <input type='number' step='0.01' name='elemento2'>
      <input type='number' step='0.01' name='elemento3'>
      <input type='number' step='0.01' name='elemento4'>
      <input type='number' step='0.01' name='elemento5'>
    </div>
</div>
<div id="boton_insertar">
<td><input type='submit' name='insertar'value='Insertar'></td>
</div>
</div>
</form>
</body>
</html>
Anotacion-2020-05-11-181432
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder