Ver Mensaje Individual
  #25 (permalink)  
Antiguo 22/09/2010, 14:05
Avatar de Nirt3
Nirt3
 
Fecha de Ingreso: septiembre-2010
Mensajes: 21
Antigüedad: 14 años, 4 meses
Puntos: 0
Respuesta: Como guardar el valor de un select en una variable y pasarla en PHP

pateketrueke, ya hice todas las modificaciones, ya las declare, ya las pongo en li consulta:

print_r($_POST);

$variable = $_POST['selecciona'];
$fecha_muestra1 = $_POST['fecha_muestra1'];
$fecha_muestra2 = $_POST['fecha_muestra2'];


$sql = "select {$variable} from churumuco where fecha_muestra>={$fecha_muestra1} and fecha_muestra<={$fecha_muestra2}";

$result=mysql_query($sql) or die( "Error en query: $sql, el error es: " . mysql_error() );

pero ahora tengo esto:

Array ( ) Error en query: select from churumuco where fecha_muestra>= and fecha_muestra<=, el error es: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from churumuco where fecha_muestra>= and fecha_muestra<=' at line 1

Porque select from churumuco, cuando yo le pongo ahi la variable, que significa esto, DISCULPA MI TARDANZA HEEEE SOY LENTA :) PERO SEGURA JAJAJ