Welcome Guest, Not a member yet? Register   Sign In
Translate MySQL entry names into something else?
#1

[eluser]Nummero2[/eluser]
Hi,

I´m right know trying to assemble a webblog for my site. Following situation:

1. created database "my_entries" with phpmyadmin including following entries
- b_id (primary key) , b_creator , b_date , b_text

2. wrote a model

3. created a form to display the content of the entries,

4. got the table entries via readalldata() instruction

5. Problem is they are showing now as b_id , b_creator , b_date , b_text in the created form (viewed via browser) so now Im asking is it possible to change that?

Meaning instead of b_id I want to show id for example, who would I do that? (So It´s just a design question)

Help, please :-(

Greetings Sebastian
#2

[eluser]Randy Casburn[/eluser]
Hi Sebastian, Sure it is. Need some more information though. It sounds like it is the column labels that are being output as b_id, b_creator, etc. Is this correct?

At some point in your code there will be some type of a loop construct that will build the HTML output for your display. Most likely this will be in a "foreach" loop and the output it is contstructing will be HTML table rows with <tr> tags and <td> tags. It is possible the content you'll want to change is getting placed inside <th> tags too. You'll need to find that and test for those values. When ever those values are found: if($var == 'b_id') then output the string you want to be displayed in the HTML table element instead.

Hope this all makes sense.

Randy
#3

[eluser]Nummero2[/eluser]
Hi Randy, thanks for your answer. What you stated is exactly my problem the column labels are being output as b_id and so on and I want them to show as just id for example (some of them I even don´t want to show at all too).

The problem is the guy who programmed it initially used a javascript form to display the table so Im now a little lost :-(
#4

[eluser]Yash[/eluser]
Show me code so that I can help..
#5

[eluser]Randy Casburn[/eluser]
Yash is right. Without showing some code we can't help you. Put up some code. Let us see that javascript.

Randy




Theme © iAndrew 2016 - Forum software by © MyBB