Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/02/2010, 05:15
rajoycalidade
 
Fecha de Ingreso: marzo-2006
Mensajes: 216
Antigüedad: 18 años, 1 mes
Puntos: 0
Ayuda por favor: You have an error in your SQL syntax

Hola estoy recibiendo un error como el siguiente:

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 'Rioja' at line 1

estoy usando un codigo como el siguiente:

Código PHP:
<?
    $region2
="La Rioja";
    
$select="SELECT * FROM concursantes WHERE region = $region2";
    
$query=mysql_query($select) or die(mysql_error());
    while(
$reg=mysql_fetch_array($query)){
¿que puede ser? porque si en el select pongo WHERE region = "La Rioja" si funciona

Ayuda por favor