NYCPHP Meetup

NYPHP.org

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

Kenneth Downs ken at secdat.com
Wed Sep 27 14:40:38 EDT 2006


Peter Sawczynec wrote:
> 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).
Name consistency is of course a great idea.
> 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'.
Strike 1, requires special handling.
>  
> In PHP:
> Can't have spaces.
Strike 2, can't do it at all
>  
> In HTML forms:
> Can have spaces, but might cause problems.
Strike 3, unpredictable results = phone call on day off
>  
> So I'm just asking for an opinion, do you deal with spaces in variables?
> Never use spaces?
>  
I think we've answered the question :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060927/d6768590/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ken.vcf
Type: text/x-vcard
Size: 261 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060927/d6768590/attachment.vcf>


More information about the talk mailing list