This topic is locked

other table fields

2/7/2008 3:52:55 PM
PHPRunner General questions
D
danaci author

hi somebody,
I want in print list other many table fields,
ex.
header part

other table fields1

-------------------------------

detail part

master table fields1 master table fields2 ....

--------------------------------------
footer part

other table fields1 other tables2 .....
thanks.

J
Jane 2/8/2008

Hi,
you can do it using custom event on the Visual Editor tab (Insert PHP code snippet option).

Here is a sample:

global $conn;

$str = "select * from AnotherTableMame";

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

while ($data = db_fetch_array($rs))

{

echo "FieldName1: ".$data["FieldName1"]."
";

echo "FieldName2: ".$data["FieldName2"]."
";

echo "FieldName3: ".$data["FieldName3"]."
";

}



where FieldName1, FieldName2 and FieldName2 are your actual field names, AnotherTableMame is your actual table name.