Article View: chile.comp.programacion
Article #441Re: problema consulta php mysql
From: jose viveros
Date: Tue, 09 Jun 2009 17:03
Date: Tue, 09 Jun 2009 17:03
41 lines
2301 bytes
2301 bytes
eso era, habia tratado de ponerle comillas pero no dabe con el lugar
correcto.
muchas gracias.
"TheSpawn" <al_simmon_spawn(sinesto)@hotmail.com> escribi๏ฟฝ en el mensaje
news:h0m4ct$scb$1@news.nivel5.cl...
> Prueba colocando comillas en la variable que viene por POST, o sea,
>
> $tablaclientes = mysql_query("SELECT * FROM cliente where Id_cliente
> ='".$_POST['seldestino']."'");
>
> Prueba de esa manera.
>
> Saludos.
>
> TheSpawn
>
>
>
> "jose viveros" <jviveros@lmn.cl> wrote in message
> news:h0m0te$hr1$1@jagger.tie.cl...
>> estoy comenzando con php y tengo un problema, al hacer una consulta de
>> sql dentro de un php si la condicion tiene algo que no sea solo numeros
>> no me devuelve ningun valor pero si solo tiene numeros me los devuelve
>> sin problemas, pongo la consulta
>>
>>
>> $tablaclientes = mysql_query("SELECT * FROM cliente where Id_cliente
>> =".$_POST['seldestino']);
>>
>>
>> si "$_POST['seldestino']" (que es un rut) tiene solo numeros la consulta
>> funciona pero si tiene una letra final el error que me devuelte es que la
>> clausula es desconocida.
>>
>> alguna idea?
>>
>
>
Technical Details
Message-ID:
<h0m4lk$j95$1@jagger.tie.cl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!news.kjsl.com!news.nivel5.cl!news.tie.cl!not-for-mailReferences:
<h0m0te$hr1$1@jagger.tie.cl> <h0m4ct$scb$1@news.nivel5.cl>Show Full Headers
Complete Article Headers
X-Google-Thread: e499fe1f24,a2a1c6bfa281fdd9 X-Google-Attributes: gide499fe1f24,public,usenet X-Google-NewGroupId: yes X-Google-Language: SPANISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!news.kjsl.com!news.nivel5.cl!news.tie.cl!not-for-mail From: "jose viveros" <jviveros@lmn.cl> Newsgroups: chile.comp.programacion Subject: Re: problema consulta php mysql Date: Tue, 9 Jun 2009 13:03:54 -0400 Organization: Telefonica Internet Empresa Lines: 43 Message-ID: <h0m4lk$j95$1@jagger.tie.cl> References: <h0m0te$hr1$1@jagger.tie.cl> <h0m4ct$scb$1@news.nivel5.cl> NNTP-Posting-Host: 200-90-179-131.static.tie.cl X-Trace: jagger.tie.cl 1244567028 19749 200.90.179.131 (9 Jun 2009 17:03:48 GMT) X-Complaints-To: news@jagger.tie.cl NNTP-Posting-Date: Tue, 9 Jun 2009 17:03:48 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Response