473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Adding header nam to any table

Hi!
I am using postgresql with PHP and C. Is it possible to add header
information to every table? For example:
id | name | age
should be
User ID | Username | Age of user
This should be displayed, when i query the header information. Is this
possible? Maybe i can add a comment to every column header? Or is there a simple
way for storeing this additional information in a other table and solve this
problem by writting some special SQL statements?

Thanks!!
cu

--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
2 1546
On Tuesday 09 September 2003 16:49, Michael Vodep wrote:
Hi!
I am using postgresql with PHP and C. Is it possible to add header
information to every table? For example:
id | name | age
should be
User ID | Username | Age of user
This should be displayed, when i query the header information. Is this
possible? Maybe i can add a comment to every column header? Or is there a
simple way for storeing this additional information in a other table and
solve this problem by writting some special SQL statements?


Well, one solution which I tend to use is to keep this information in my
application layer (PHP/C in your case).

Since PHP will need to know something about the structure of the database
anyway, I keep all this together. Something like:

$Tables['user_age'] = array(
'id' => array('type' => 'int', 'desc'=>'User ID'),
'name' => array( 'type'=>'text', 'desc'=>'User name' ),
'age' => array('type'=>'int', 'desc'=>'Age of user' )
);

In fact, where possible I like to generate the above table and my SQL from the
same definitions-file.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2
On Tue, 2003-09-09 at 10:49, Michael Vodep wrote:
Hi!
I am using postgresql with PHP and C. Is it possible to add header
information to every table? For example:
id | name | age
should be
User ID | Username | Age of user


In psql, you can do:
SELECT id as "User ID", name as "Username", age as "Age of user"
FROM foobar;

A special table where you manually map field names to descriptive
would also work, and be generic.

--
-----------------------------------------------------------------
Ron Johnson, Jr. ro***********@cox.net
Jefferson, LA USA

"Fair is where you take your cows to be judged."
Unknown
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table...
2
by: Michael Vodep | last post by:
Hi! I am using postgresql with PHP and C. Is it possible to add header information to every table? For example: id | name | age should be User ID | Username | Age of user This should be...
8
by: Raven | last post by:
Hello, I get a error message when I try to Add data in a relational Access Database. This is the error message: "You cannot add or change a record because a related record is required in...
3
by: AMD Desktop | last post by:
Hi, I need to add a header to a datagrid. This is the code I am trying to use: Dim dgStaffingReport As New DataGrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell...
1
by: swc76801 | last post by:
I desperately need help. My understanding of CSS is non-existent. I have a store http://astore.amazon.com/texasheat-20 with Amazon.com. According to the information from Amazon.com "Write your own...
2
by: Kevin Blount | last post by:
I'd like to create a script that adds rows to an existing table, which has a header and footer row. The new row should be added as the last row BEFORE the footer. Here's what I have, though it...
1
by: Jack | last post by:
Hi, I am new to .NET and need help with adding click event on LinkButton programatically. Please see the code below. I would like to add a click event on LinkButton returned from "Function...
7
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
1
by: chandhseke | last post by:
Hi folks, I am a newbie to this functionality of creating excel report using VB/VB Script. I have been given a code and asked to add filters to the excel sheet that is created using the below...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.