This topic is locked

Two Tables in same page (custom page)

6/15/2010 6:03:28 AM
PHPRunner General questions
S
Seraph author

Hi to all.

I'm new and noob in PHPRunner but I want to learn!
My problem is:

I have a database ( obviously <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=14630&image=1&table=forumtopics' class='bbc_emoticon' alt=':D' /> ) , I create and configurate all the page that i need (add page, list page...) and now I want create a "Front Page" that show two of my tables (the most important) and only the first 10rows.

Example:
------------------------------------------------------

--FRONTPAGE--

Welcome to this application!
Description of Table1

Table1

row1

row2

...row10
Description of Table2

Table2

row1

row2

...row10

------------------------------------------------------
So, I need to know How I can to create a Custom page (different from Add-Page, List-Page...).
Thank you very much

A
ann 6/15/2010

Hi,
you can create custom view on the Datasource tables tab. To select tables you want to display (and corresponding fields) create a code snippet on the Visual Editor tab. Here is just a sample code of the snippet which will display ten first records of the table 1:

$sql="select * from TableName LIMIT 10";

$rs=CustomQuery($sql);

echo "Id FieldName
";

while ($data=db_fetch_array($rs))

{echo $data["Id"]." ".$data["FieldName"]."
";}



here is Id, FieldName are actual field names, TableName is actual table name.

Create similar snippet for the table 2.

S
Seraph author 6/15/2010

Thank you very much for answer. I try immidiatly!
Only a little thing... What is CustomQuery() function? is a API of phprunner?
thanks!

A
ann 6/15/2010

Hi,
CustomQuery() is Data Access Layer (DAL) function of PHPRunner.

More detailed:

http://xlinesoft.com/phprunner/docs/data_access_layer.htm

S
Seraph author 6/15/2010

Hi,

i don't know yet.

Why I have to create a single CustoView?

I need to show 2 tables in same page, one in top of the page and the second in the footer...

If I put the fields of the tables in a View, after I can't to divide them...
Thank you very much

M
mpatten 6/15/2010

Just a thought,
You could do two custom views and then just do two iframes on a external page?