NYCPHP Meetup

[nycphp-talk] naming identifiers

lists at nopersonal.info lists at nopersonal.info
Sun Aug 30 09:48:14 EDT 2009


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





More information about the talk mailing list