Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am using mysql with php Yii framework.When doing data modelling I came accross some doubt.I have a table for user details like this.

CREATE TABLE IF NOT EXISTS `tbl_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(80) NOT NULL DEFAULT '',
  `lastname` varchar(80) NOT NULL DEFAULT '',
  `gender` varchar(6) NOT NULL DEFAULT '',
  `email` varchar(45) NOT NULL DEFAULT '',
  `company_name` varchar(80) NOT NULL DEFAULT '',
  `contact_no` varchar(45) NOT NULL DEFAULT '',
  `address` varchar(120) NOT NULL DEFAULT '',
  `state` varchar(45) NOT NULL DEFAULT '',
  `country` varchar(45) NOT NULL DEFAULT '',
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=98 ;

Here my problem is I want the state,country should be like this so that I can use the fields like state/city

 `state/city` varchar(45) NOT NULL DEFAULT '',
  `state/province` varchar(45) NOT NULL DEFAULT '',

So is it safe to use like this or I have to use only one option there?Any help and suggestions will be highly appriciable.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

From this link:

Database and table names cannot contain “/”, “\”, “.”, or characters that are not permitted in file names

I recommend that you use an underscore character instead.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.