This topic is locked

need generic dblookup function

8/25/2006 11:59:41 AM
PHPRunner General questions
F
frocco author

Is there a dblookup function already coded inPHPRunner?
I need to lookup data and customize my xxxList.php template

if certain conditions are met.
What would the dbLookup syntax be?
Thanks
Frank

J
Jane 8/28/2006

Frank,
I'm not sure that I understand you correctly.

Please clarify what does it mean "dbLookup" function?

F
frocco author 8/28/2006

A generic function to pass a sql statement and field name and return its value.
$value - dLookup($sql,$field);
I also have a problem in my child list.

I want to disable the Add button when a record is marked closed.

e.g. ticketClosed=1
Thanks for your help Jane.
Frank

J
Jane 8/28/2006

Frank,
to pull in field value use following code:

global $conn;

$str = "select * from TableName";

$rs = mysql_query($str,$conn);

$data = mysql_fetch_array($rs, MYSQL_ASSOC);

echo $data["Fieldname"];

F
frocco author 8/28/2006

Thanks Jane,
That did the trick.
Regards,
Frank

Frank,

to pull in field value use following code: