This topic is locked

snippet with variable

6/30/2009 8:11:57 AM
PHPRunner General questions
W
webdino author

Hello,
I have some variables in my template.

Now I want to select a value from the database which contains the value of the variable ID
Select name from table where ID=$ID;
This ID is in my field list. The list page contains

ID, ID2, Text......
How can I get the value of ID in my codesnippet to select another value from another table?
Thanks for help.

J
Jane 7/1/2009

Hi,
unfortunately there is no easy way to pass parameters to the custom events on the Visual Editor tab.

As workaround use custom format on the "View as" settings dialog on the Visual Editortab.

W
webdino author 7/3/2009

that´s not good when I will show a text only no database field then I must decide which ID from a customer is now active.

Therefore I must know the ID of the dataset. Can I find it in the session variables or can I do something to the application to send it always?

J
Jane 7/3/2009

Hi,
please give me more detailed description of where do you want to select ID value.

W
webdino author 7/4/2009

I have some data like this
ID Customer Description Pointer

1 Test Testdescription 1 Link1 Link1

2 Test1 Testdescription 2 Link1 Link2
My Solution should be to show only link1 when the variable pointer is 1 otherwise I will show the link2. Therefore I must answer in a part of my script which value the variable pointer of this customer is set

J
Jane 7/6/2009

Hi,
use custom format for Pointer field on the"View as" settings dialog on theVisual Editortab.

Here is just a sample:

if ($value==1)

$value = "Link1";

if ($value==2)

$value = "Link2";