Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/08/2008, 15:34
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Consulta erronea

Hola,
Estoy haciendo una funcion que hace una consulta:
Código PHP:
function ver_dat_sql($t,$d,$w,$a){
include(
'config.ini.adm.php');
$sql="SELECT * FROM ".$t." WHERE ".$d." = '".$w."'";
$query mysql_query($sql,$conexion) or die(mysql_error()); 
$data mysql_fetch_array($query); 
if(!empty(
$data[$a]))
return 
$data[$a];
else
return 
"Session vacia.";

Pero no me anda, me dice:
Cita:
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 'option WHERE op = 'contactos'' at line 1
La base de datos existe y la tabla tambien.
Gracias
Salu2
__________________
Half Music - www.halfmusic.com