NYCPHP Meetup

NYPHP.org

[nycphp-talk] naming identifiers

Kristina D. H. Anderson ka at kacomputerconsulting.com
Sun Aug 30 10:05:44 EDT 2009


Bev,

Good morning to you as well!  I'd imagine that yes, the table-creation 
widget inside phpMyAdmin probably does execute the queries that way, as 
that seems to be its default mode.  I'm not sure if you can change 
settings to remove that behavior...

There are a lot of reasons to like phpMyAdmin (well, a few reasons at 
least) but also a lot of reasons to hate it.  For instance, once the 
database reaches a certain size, you won't be able to back it up using 
phpMyAdmin, but will have to use the command line.  That's sort of lame.

At the bare minimum, if you're going to use phpMyAdmin to create 
tables, do it in raw SQL instead of using the widget.  

PS I'm wondering what my mother would say if she knew I spent basically 
my entire weekend talking about databases..."that's no way to find a 
husband, Kristina" is what she'd probably say...and she's probably 
right.  Lucky thing I'm not looking for one....!

:) Kristina

> Good Morning Kristina,
> 
> Kristina D. H. Anderson wrote:
> > phpMyAdmin often puts those funny sideways leaning 
apostrophes/quotes --
> >  ` -- around table names and field names when it writes its 
queries.  
> > You want to remove those before you create or change any table or 
field 
> > names, I think is what he means in practical terms.  That way you 
will 
> > get errors on reserved words.
> 
> I've seen those odd little quotes on the few occasions that I've used
> phpMySQL to create queries, but the thing is I didn't use that when I
> created the tables--I just used the little text field on the main db
> page to give it a name, then entered how many fields I wanted and
> clicked "Go". So it must have inserted them behind the scenes.
> 
> > Also you can try to avoid your own confusion by giving longer, more 
> > detailed names to fields.  Some people hate this idea but to me a 
> > little extra typing is worth the clarity.
> 
> Amen to that! That's exactly what I'm doing these days. If a field 
name
> doesn't warrant an underscore, then I have to be 100% sure that it's 
not
> a reserved word--if I'm not sure, then I check. There is no way I want
> to repeat that suffering again.
> 
> Bev
> 
> 
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> http://www.nyphp.org/show_participation.php
> 
> 








More information about the talk mailing list