This topic is locked

Displaying an entry from the database

7/6/2007 9:50:56 AM
PHPRunner General questions
P
Php_is_hard author

Hello,
I am relatively new to Php/MySQL, so please forgive any seemingly easy questions.
I created a database, and everything is working perfectly fine. However, now I would like to modify the "View" page. In addition to showing variables from the specified table, I would also like to show an entry from a different table. For example, let us call the table that I have already used _case_studies, and the secondary table _comments. These tables are both in the same MySQL database.
If this variable that I want to add was from the _case_studies table, I could simply use the following syntax in the HTML code:
{$show_Comment} // Comment being the column name.
However, there was nothing assigned to this variable.
I go into _case_studies_view.php and see
////////////////////////////////////////////

// steroids -

$value="";

$value = ProcessLargeText(GetData($data,"steroids", ""),"","",MODE_VIEW);

$smarty->assign("show_steroids",$value);
I tried retooling this for the Comment column, but clearly it didn't work because the column is in a different table.
I attempted to search for where the GetData and ProcessLargeText function definitions are stored, but couldn't find it (Windows find didn't give ANY results).
So, now I am stuck. Any help would be greatly appreciated.

Sergey Kornilov admin 7/8/2007

I would suggest to use ViewOnLoad event where you can display everything you need.

P
Php_is_hard author 7/10/2007

I would suggest to use ViewOnLoad event where you can display everything you need.


Thank you!