I am using MySQL for web database backends. This invariable involves pulling
the data from the tables and displaying on web browser forms and such like.
I know that I can't use spaces in my column names. What is the standard way
of naming colums bearing in mind the conversion on the name to a displayable
format in the web browser eg.
NAMING CONVENTION 1.
-------------------------------
SQL column:
. your_full_name
On-screen display:
. Your full name
HTML:
. Your full name: <input name="your_full_name" value="$your_full_name">
NAMING CONVENTION 2
-----------------------
SQL column:
. yourFullName
On-screen display:
. Your Full Name
HTML:
. Your full name: <input name="yourFullName" value="$yourFullName">
I personally prefer the second convention for readability and efficiency.
Converting either convention to on-screen display is very each.
I want to make my programs as portable and platform independant as possible.
Any thoughts?
Thanks,
Lee.
On Thu, 10 May 2001 09:37:51 +0100,
"Lee" == Lee Osborne <osbor...@hotmail.com> wrote:
Lee> NAMING CONVENTION 1.
Lee> SQL column:
Lee> . your_full_name
Lee> On-screen display:
Lee> . Your full name
Lee> HTML:
Lee> . Your full name: <input name="your_full_name" value="$your_full_name">
Lee> NAMING CONVENTION 2
Lee> SQL column:
Lee> . yourFullName
Lee> On-screen display:
Lee> . Your Full Name
Lee> HTML:
Lee> . Your full name: <input name="yourFullName" value="$yourFullName">
Lee> I personally prefer the second convention for readability and efficiency.
why efficiency? String mangling foo_bar into "Foo Bar" costs practically
nothing, and the extra few bytes for the "_"'s should be neglible as well.
Lee> I want to make my programs as portable and platform independant as
Lee> possible.
in that case, use the foo_bar convention, since SQL databases are not
required to preserve the case of the table or column names. E.g. if you
dynamically acquire the column names from the Data Dictionary (which is what
I assumed are doing all along), then you will get them in all upper case for
Oracle, and prolly others as well. It also leavesyou more leeway, since you
can change the capitalization conventions without changing your database
schema.
Philip
--
If you have a procedure with 10 parameters, you probably missed some. (Kraulis)
-----------------------------------------------------------------------------
Philip Lijnzaad, lijn...@ebi.ac.uk \ European Bioinformatics Institute,rm A2-08
+44 (0)1223 49 4639 / Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax) \ Cambridgeshire CB10 1SD, GREAT BRITAIN
PGP fingerprint: E1 03 BF 80 94 61 B6 FC 50 3D 1F 64 40 75 FB 53
>Hi all,
>
>I am using MySQL for web database backends. This invariable involves pulling
>the data from the tables and displaying on web browser forms and such like.
>
>I know that I can't use spaces in my column names. What is the standard way
>of naming colums bearing in mind the conversion on the name to a displayable
>format in the web browser eg.
>
>NAMING CONVENTION 1.
>-------------------------------
>
>SQL column:
>
> . your_full_name
>
>On-screen display:
>
> . Your full name
>
>HTML:
>
> . Your full name: <input name="your_full_name" value="$your_full_name">
>
>
>
I may not understand fully what you want but could you when you build
your select statement for presentation do:
SELECT your_full_name as "Your full name" from your_table where ....;
This is the syntax i use with PostgreSQL.
I prefer to use _ instead of space if i need it in my table and column
names since it is to troublesome to use big letters.
--
Rolf