[PHP] MySQL table design

2012-03-22 Thread Chris Stinemetz
Hello List,

Is it possible to create a MySQL table with characters such as . and
[] in the column headers? If so would you explain how?

Thank you,

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL table design

2012-03-22 Thread Stuart Dallas
On 23 Mar 2012, at 00:10, Chris Stinemetz wrote:

 Is it possible to create a MySQL table with characters such as . and
 [] in the column headers? If so would you explain how?

Try putting the column names in backticks (`).

BUT... whatever the reason why you want to do that, IT'S WRONG.

Seriously, don't do it. It will cause you more problems than you think it will 
solve, and I don't even know what problem you think it will solve.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL table design

2012-03-22 Thread Bastien


On 2012-03-22, at 8:10 PM, Chris Stinemetz chrisstinem...@gmail.com wrote:

 Hello List,
 
 Is it possible to create a MySQL table with characters such as . and
 [] in the column headers? If so would you explain how?
 
 Thank you,
 
 Chris
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Periods are not allowed, nor other characters that are reflected in file paths. 

You can use the back tick to wrap the field names, but I really don't recommend 
it. If you ever need to port this to another DB, it might not be as forgiving

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL table design

2012-03-22 Thread Chris Stinemetz
On Thu, Mar 22, 2012 at 7:42 PM, Stuart Dallas stu...@3ft9.com wrote:
 On 23 Mar 2012, at 00:10, Chris Stinemetz wrote:

 Is it possible to create a MySQL table with characters such as . and
 [] in the column headers? If so would you explain how?

 Try putting the column names in backticks (`).

 BUT... whatever the reason why you want to do that, IT'S WRONG.

 Seriously, don't do it. It will cause you more problems than you think it 
 will solve, and I don't even know what problem you think it will solve.


I am just trying to preserve the source headers from the original data
I want to import into the table.

Thank you,

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL table design

2012-03-22 Thread Jim Giner
Leave the past behind.  You're moving forward.  And - for whatever reason 
that they were used originally, you now have the opportunity to rid yourself 
of column names that must be a pia to type all the time. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php