komaldeep chahal
komaldeep chahal

Reputation: 61

Laravel 5 [PDOException] SQLSTATE[42000]: Syntax error or access violation:

** [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column na me 'INTERESTED IN INTERNSHIP JOB '**

**in this column INTERESTED IN INTERNSHIP JOB is radio button **

**in this column SEX , INTERESTED IN INTERNSHIP JOB , AND ABOVE 18 ARE RADIO BUTTON **

public function up()
{
        Schema::create('students',function(Blueprint $table)
  {
    $table-> increments('id');
    $table-> char('FIRST NAME',50 );
    $table-> char('LAST NAME',50 );
    $table-> string('EMAIL',50 );
    $table-> string('SEX',50);
    $table-> string('INTERESTED IN INTERNSHIP JOB ',50);
    $table-> text('SKILLS');
    $table-> string('above18',50);
    }); 

}

Please help me resolve the aforementioned error, as I am stuck.

Upvotes: 2

Views: 1300

Answers (1)

pinkal vansia
pinkal vansia

Reputation: 10330

One advice though never use uppercase for column names otherwise there can cross platform issues between windows(case-insensitive) and Linux(Case-sensitive)

http://justinsomnia.org/2003/04/essential-database-naming-conventions-and-style/

UPDATE

change 'INTERESTED IN INTERNSHIP JOB ' to 'INTERESTED IN INTERNSHIP JOB'

There is an additional space at the end of column name and '

Upvotes: 2

Related Questions