NYCPHP Meetup

NYPHP.org

[nycphp-talk] About Human Readable Variable Names Moving Among PHP, HTML and MySQL

Peter Sawczynec ps at pswebcode.com
Wed Sep 27 06:34:27 EDT 2006


I'm always attempting a tight level of coordinated, human readable
consistent naming for my data, i.e. I try to:
a) use the same name such as "First Name" on my HTML form, 
b) use that variable name in my PHP script (i.e. $First_Name), and 
c) get the field name in tables in MySQL to match (again i.e. FirstName).
 
When I work on projects that have HTML forms, email confirmations, MySQL
storage, 
and Admin tools that view and sort the data, it is very handy when all the
data variable names 
are uniform and human readable at the same time. This way the onscreen HTML 
display name for data variables can be the actual data name itself, and then
I can 
do less custom work when presenting data to all the users, in any
permutation. 
 
My issues are about the spaces in data names. (To me, spaces is what makes
data names 
human readable.)
 
In MySQL:
I forget, you can use spaces, but should surround in tics, right. Like so:
'First Name'.
 
In PHP:
Can't have spaces.
 
In HTML forms:
Can have spaces, but might cause problems.
 
So I'm just asking for an opinion, do you deal with spaces in variables?
Never use spaces? 
 
Is the problem of spaces just an old legacy, cross platform Windows/Mac/Unix
bad memory I have?
 
Warmest regards, 
 
Peter Sawczynec 
Technology Director 
PSWebcode 
_Design & Interface 
_Ecommerce 
_Database Management 
646.316.3678 
ps at pswebcode.com 
www.pswebcode.com <http://www.pswebcode.com/>  
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060927/77282c1c/attachment.html>


More information about the talk mailing list