This topic is locked

Show data from master table on a Custom Field page

12/20/2016 6:16:11 AM
PHPRunner General questions
T
tiagoperes author

[size="2"]



[b][color="#4169E1"]Action: insert the code pasted bellow inside PHPRunner, Editor screen, HTML Mode, in a new custom file called home.htm

The code:

<?php

global $dal, $strTableName;

if ($_SESSION[$strTableName."_masterkey1"]) {

$tblOrders = $dal->Table("Events");

$rs = $tblOrders->Query("eventID=".$_SESSION[$strTableName."_masterkey1"],"");



if ($data = db_fetch_array($rs)) {

echo '<A href="#"></A>

<DIV class="event1 odd">

<A href="#">

<DIV class="event-icon"></DIV>

</A>

<DIV class="event-container">

<A href="#">

<H2 class="event-title">'.$data["Event_Name"].'</H2>

<P class="date">'.$data["Start_Date"].'</P>

<P class="event-desc">'.$data["Event_Description"].'</P>

</A>

<H2 class="event-info">

<A href="#">More information</A>

</H2>

</DIV>

</DIV>';

}

}

?>



Reaction:

  1. The data is not being displayed
  2. The php code is appearing in the view as text


////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Where can one see the problem? Here, in this link

Scrolling down to the section 'TODAY IN LAS CRUCES', there's a div with 'Las Cruces Events'. There, you'll see the PHP code showing in the view.
A number of things can go wrong in the code.

To make sure it's ok, one needs to:
A. Make sure all table and field names are correct (case-sensitive).

(they are correct)
B. Make sure that $_SESSION[$strTableName."_masterkey1"] variable is populated.

How do I do it?



Research lead me to this: http://php.net/manual/en/function.empty.php
C. Make sure the query returns data.

Where can this be done using PHPRunner?
How to do it:

Add the following statement there, copy the SQL and execute it manually against your database to see if any data is there and there are no errors:

echo "select * from events where eventID=".$_SESSION[$strTableName."_masterkey1"];


Thanks in advance for all the help reaching the goal

Tiago Peres

PHPRunner Enterprise 9.6

[/size]

J
joshfolgado 12/20/2016



[size="2"]



[b][color="#4169E1"]Action: insert the code pasted bellow inside PHPRunner, Editor screen, HTML Mode, in a new custom file called home.htm

The code:

<?php

global $dal, $strTableName;

if ($_SESSION[$strTableName."_masterkey1"]) {

$tblOrders = $dal->Table("Events");

$rs = $tblOrders->Query("eventID=".$_SESSION[$strTableName."_masterkey1"],"");
if ($data = db_fetch_array($rs)) {

echo '<A href="#"></A>

<DIV class="event1 odd">

<A href="#">

<DIV class="event-icon"></DIV>

</A>

<DIV class="event-container">

<A href="#">

<H2 class="event-title">'.$data["Event_Name"].'</H2>

<P class="date">'.$data["Start_Date"].'</P>

<P class="event-desc">'.$data["Event_Description"].'</P>

</A>

<H2 class="event-info">

<A href="#">More information</A>

</H2>

</DIV>

</DIV>';

}

}

?>



Reaction:

  1. The data is not being displayed
  2. The php code is appearing in the view as text
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    Where can one see the problem? Here, in this link

    Scrolling down to the section 'TODAY IN LAS CRUCES', there's a div with 'Las Cruces Events'. There, you'll see the PHP code showing in the view.
    A number of things can go wrong in the code.

    To make sure it's ok, one needs to:
    A. Make sure all table and field names are correct (case-sensitive).

    (they are correct)
    B. Make sure that $_SESSION[$strTableName."_masterkey1"] variable is populated.

    How do I do it?



    Research lead me to this: http://php.net/manual/en/function.empty.php
    C. Make sure the query returns data.

    Where can this be done using PHPRunner?
    How to do it:

    Add the following statement there, copy the SQL and execute it manually against your database to see if any data is there and there are no errors:

echo "select * from events where eventID=".$_SESSION[$strTableName."_masterkey1"];


Thanks in advance for all the help reaching the goal

Tiago Peres

[/size]

J
joshfolgado 12/20/2016



[size="2"]



[b][color="#4169E1"]Action: insert the code pasted bellow inside PHPRunner, Editor screen, HTML Mode, in a new custom file called home.htm

The code:

<?php

global $dal, $strTableName;

if ($_SESSION[$strTableName."_masterkey1"]) {

$tblOrders = $dal->Table("Events");

$rs = $tblOrders->Query("eventID=".$_SESSION[$strTableName."_masterkey1"],"");
if ($data = db_fetch_array($rs)) {

echo '<A href="#"></A>

<DIV class="event1 odd">

<A href="#">

<DIV class="event-icon"></DIV>

</A>

<DIV class="event-container">

<A href="#">

<H2 class="event-title">'.$data["Event_Name"].'</H2>

<P class="date">'.$data["Start_Date"].'</P>

<P class="event-desc">'.$data["Event_Description"].'</P>

</A>

<H2 class="event-info">

<A href="#">More information</A>

</H2>

</DIV>

</DIV>';

}

}

?>



Reaction:

  1. The data is not being displayed
  2. The php code is appearing in the view as text
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    Where can one see the problem? Here, in this link

    Scrolling down to the section 'TODAY IN LAS CRUCES', there's a div with 'Las Cruces Events'. There, you'll see the PHP code showing in the view.
    A number of things can go wrong in the code.

    To make sure it's ok, one needs to:
    A. Make sure all table and field names are correct (case-sensitive).

    (they are correct)
    B. Make sure that $_SESSION[$strTableName."_masterkey1"] variable is populated.

    How do I do it?



    Research lead me to this: http://php.net/manual/en/function.empty.php
    C. Make sure the query returns data.

    Where can this be done using PHPRunner?
    How to do it:

    Add the following statement there, copy the SQL and execute it manually against your database to see if any data is there and there are no errors:

echo "select * from events where eventID=".$_SESSION[$strTableName."_masterkey1"];


Thanks in advance for all the help reaching the goal

Tiago Peres

[/size]

J
joshfolgado 12/20/2016

I have the same issue.
Cant find documentation showing how to populate data from PHPRunner into bootstrap page anywhere.
I am also raising a ticket and posting an entry on this forum.
We need better documentation on how to do things using the new bootstrap offering, would prevent asking questions as there is little to no documentation on it.