This topic is locked

New user - Question - Q2

7/23/2006 7:21:07 AM
PHPRunner General questions
M
mmponline author

Is there a easy way to join 2 fileds in one? Eg. Name and Surname? The example I've tried, gave the result as a number.

J
Jane 7/24/2006

Stephan,
sure you can do it to edit SQL query on the Edit SQL query tab in the following way:

select field1,

concat(`Name`,' ',`Surname`) as `Full Name`

from table1



where table1 is your actual table name.

M
mmponline author 7/24/2006

Thanks for that one, works great! Now for a bigger challenge:

  1. As template features are not available for WYSIWYG, I need a two column view. How do I do this. I know I need to edit the *_view.php. But how?
  2. This template needs headings after a certain amount of fields. Can this be put in as "blank" entries in Edit SQL Query that shows Information that doesn't come from the database - This heading must be different color as well, f possible)
    Eg.
    **** Personal Info [/color][/b]

    Name: kkkkkk Surname: aaaaa

    Contact info

    Tel: 3548955 Postal address: PO Box. 94398483

    Etc.

M
mmponline author 7/24/2006

Jane
Further implications
After adding the combined fields (only used concat(`knownname`,' ',`surname`) as `Full Name`, ) as the Table name is the same, my whole table field order was set back to the original order, and all labels the same as the table names. I'll have to redo everything from scratch as the project was saved already.
Is it because I didn't use field 1 and the table name? Lost hours.
Stephan

J
Jane 7/24/2006

Stephan,
you can do it editing generated files manually.

  1. to create two columns on the VIEW page you need to delete some <tr> tags in the ..._view.php file.
  2. to add your headers locate following line in the ..._view.php file:
    echo "<table cellpadding=2>";



and add this code before it:

echo "<font color=#763512>Personal info</font>";


Please note that all changes are removed after you rebuild your pages. Therefore modify generated pages when you've completed your project.

M
mmponline author 7/24/2006

Any help on which tr tags to remove? Ther are thousands and I need to setup this project with other usability as well, meaning that I'll have to handcode them as well????

Alexey admin 7/24/2006

Stephan,
you need to look at the following lines in your ..._view.php file:

See the tags to remove in bold

echo "\r\n<tr><td class=shade>".Label("Field1")." </td><td>";

...

echo "</td></tr>";

...

echo "\r\n<tr><td class=shade>".Label("Field2")." </td><td>";

...

echo "</td></tr>";

...

echo "\r\n<tr><td class=shade>".Label("Field3")." </td><td>";

...

echo "</td></tr>";

...

echo "\r\n<tr><td class=shade>".Label("Field4")." </td><td>";

...

echo "</td></tr>";