1
corne
Query not executed
  • 2005/2/9 12:31

  • corne

  • Just popping in

  • Posts: 24

  • Since: 2005/1/12


Hi,

I have a query, and it doesn't execute when I enter the page,

Example, I use the button in the menu to enter the page, than the query doesn't execute. When I send something through POST on this page, the query does execute...

So in my opinion, XOOPS only executes query's when the page is accessed through post... But the query I had before this one worked...

The query I use is:

Quote:

select
id, descr, freq, event_count
from
xoops_servex_event sa
LEFT OUTER JOIN
(select
event_id, count(*) as event_count
from
(select
distinct location_id, event_id
from
xoops_servex_event_link
where
time_until < now() OR time_until > now() OR false
) as foo
GROUP BY
event_id
) as foo
ON sa.id = foo.event_id
where
event_count > 0 OR true
ORDER BY
lower(descr) asc;


This is the database dump after a post from the site.. This query isn't executed when I open the page a normal way...

Is there a way around this??

2
Mithrandir
Re: Query not executed

How exactly do you write the PHP code for executing this query? (just copy-paste the $sql = "SELECT [...]" or $db->query("SELECT[...]") section without it getting too long)

3
corne
Re: Query not executed
  • 2005/2/9 13:03

  • corne

  • Just popping in

  • Posts: 24

  • Since: 2005/1/12


This is the query:

Quote:

$select_qwry = '
select
id, descr, freq, event_count
from
'.$xoopsDB->prefix("servex_event sa").'
LEFT OUTER JOIN
(select
event_id, count(*) as event_count
from
(select
distinct location_id, event_id
from
'.$xoopsDB->prefix("servex_event_link").'
where
time_until < now() OR time_until > now() OR false
) as foo
GROUP BY
event_id
) as foo
ON sa.id = foo.event_id
where
event_count > 0 OR true
ORDER BY
lower('.$order.') '.$orderM.';
';


execute the query:
Quote:

$select_res = $xoopsDB->query($select_qwry);

4
Mithrandir
Re: Query not executed

Change it to this:
$select_qwry 'select
id, descr, freq, event_count
from
[...]

There may not be anything between the quote and "select" when the request method is GET.

5
corne
Re: Query not executed
  • 2005/2/9 13:21

  • corne

  • Just popping in

  • Posts: 24

  • Since: 2005/1/12


it works thanks

Login

Who's Online

129 user(s) are online (83 user(s) are browsing Support Forums)


Members: 0


Guests: 129


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits