Forums: "$values" It can be used in a "where" clausule? - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

"$values" It can be used in a "where" clausule? Rate Topic: -----

#1 User is offline   Aleix 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 54
  • Joined: 13-July 08

Posted 10 March 2010 - 01:06 PM

Hi;

(PHPRunner 5.2 (Build 4905))

We want to do a dropdown dependent, but using WHERE, (No using dopdown option. In this way we will can do filters more specific)

Some like that:

WHERE "Area =" .$values("Area") We hope that Where clause filter the countries that belong to the Area that the user selected before

But It do not work,
Error Type 8
Undefined variable: values


Are we doing some thing wrong or "$values" it can not be used in the page?

Are there another way for to filter the content of Dropdown box by the fields that the user wrote? (No using dopdown option. In this way we will can do filters more specific)


Thanks in advance

Aleix
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 8453
  • Joined: 03-February 03

Posted 10 March 2010 - 11:35 PM

Instead of $values array which is not available here you can use a session variable i.e. WHERE "Area =" .$_SESSION["Area"].

Session variable can be populated in BeforeProcess or BeforeDisplay event of the Edit page.
Best regards,
Sergey Kornilov
0

#3 User is offline   Aleix 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 54
  • Joined: 13-July 08

Posted 13 March 2010 - 11:03 PM

Hello Sergey;

First thanks for your time

I tried

WHERE "Area =" .$_SESSION["Area"] --> type error: 256; Description error: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 ') ORDER BY `_zzubic01b_pais`.`IdUbicPais`' at line 1
1. SELECT DISTINCT `UbicPais`,`UbicPais` FROM `_zzubic01b_pais` WHERE (Area =) ORDER BY `_zzubic01b_pais`.`IdUbicPais`;
2. Resource id #11;


and try too with :

WHERE "Area =" .$_SESSION[‘Area’] --> type error: 8; Description error: Use of undefined constant ‘Area’ - assumed '‘Area’'

But in the both cases I have error. What am I doing badly?

Thanks for your help

Aleix
0

#4 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 8453
  • Joined: 03-February 03

Posted 14 March 2010 - 01:58 PM

You need to populate $_SESSION["Area"] variable in BeforeProcess or BeforeDisplay event of the Edit page. According to what I see this variable is not populated which causes SQL query error.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users