Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
problema en subconsulta Mysql con php
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
XTeo  
View profile   Translate to Translated (View Original)
 More options Feb 12 2010, 4:31 pm
From: XTeo <eagui...@gmail.com>
Date: Fri, 12 Feb 2010 13:31:29 -0800 (PST)
Local: Fri, Feb 12 2010 4:31 pm
Subject: problema en subconsulta Mysql con php
Hola, tengo una consulta sql en Mysql con una subconsulta en el
Select, de este tipo :

SELECT a.num_salida, a.fecha_salida, a.num_variante
    (SELECT C.num_maquina FROM crw_salidas.salidas as C WHERE
C.num_empresa= 23 and
        (C.fecha_salida > a.fecha_salida) ORDER by C.fecha_salida ASC LIMIT
0,1) AS maq_siguiente
FROM crw_salidas.salidas a
WHERE a.num_maquina = 1 AND (a.fecha_salida between '2010-02-01
00:00:00' AND '2010-02-01 19:24:00') AND a.num_empresa = 23
ORDER BY a.num_variante ASC, a.fecha_salida ASC

En la consola o Admin Mysql funciona sin problema.

Pero cuando llevo esa consulta a php+mysql para ponerla en la pagina,
la consulta del la columna "maq_siguiente" creada con subconsulta no
trae datos.

Ya he probado y analizado bien y no se cual es el problema.
Probe en mi pc y tambien en el serividor, con la misma configuracion :
php 5.2.6 y mysql 5.0.5   y nada

Agradeceria si alguien me da alguna idea.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chema  
View profile   Translate to Translated (View Original)
 More options Feb 15 2010, 5:15 pm
From: chema <neo...@gmail.com>
Date: Mon, 15 Feb 2010 14:15:48 -0800 (PST)
Local: Mon, Feb 15 2010 5:15 pm
Subject: Re: problema en subconsulta Mysql con php
Como intentas leer los datos?

Resulta algo extraño. Seguro devuelve algo? no hay nada modificando la
consulta?

saludos

On Feb 12, 10:31 pm, XTeo <eagui...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ignacio Tolstoy  
View profile   Translate to Translated (View Original)
 More options Feb 15 2010, 6:20 pm
From: Ignacio Tolstoy <arkantos...@gmail.com>
Date: Tue, 16 Feb 2010 00:20:07 +0100
Local: Mon, Feb 15 2010 6:20 pm
Subject: Re: problema en subconsulta Mysql con php

igual los paréntesis dentro de la subconsulta se cierran mal?
intentaste hacer la consulta directamente a mysql?

El 15 de febrero de 2010 23:15, chema <neo...@gmail.com> escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Esteve Maruri i Camps  
View profile   Translate to Translated (View Original)
 More options Feb 16 2010, 2:20 am
From: Esteve Maruri i Camps <estevemar...@gmail.com>
Date: Tue, 16 Feb 2010 08:20:15 +0100
Local: Tues, Feb 16 2010 2:20 am
Subject: Re: problema en subconsulta Mysql con php

Falta una coma tras a.num_siguiente, no?

El 15/02/2010 23:20, "Ignacio Tolstoy" <arkantos...@gmail.com> escribió:

igual los paréntesis dentro de la subconsulta se cierran mal?
intentaste hacer la consulta directamente a mysql?

El 15 de febrero de 2010 23:15, chema <neo...@gmail.com> escribió:

> Como intentas leer los datos?

> Resulta algo extraño. Seguro devuelve algo? no hay nada modif...

--
Has recibido este mensaje porque estás suscrito al grupo "Grupo de
programadores PHP de Barcelon...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
César  
View profile   Translate to Translated (View Original)
 More options Feb 17 2010, 7:45 am
From: César <ce...@anui.org>
Date: Wed, 17 Feb 2010 13:45:21 +0100
Local: Wed, Feb 17 2010 7:45 am
Subject: Re: problema en subconsulta Mysql con php

Buenas,

�qu� te devuelve exactamente el campo maq_siguiente? �null?

�puedes ense�arnos la estructura de la tabla?

podr�as probar a cambiar esto: (C.fecha_salida > a.fecha_salida)
por esto: DATEDIFF(C.fecha_salida, a.fecha_salida) > 0

saludos,

C�sar

Ignacio Tolstoy escribi�:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »