Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alonegamer's avatar

Incorrect table name error.

i have this project by a friend. he is not into coding anymore so he can't help in this. so this project is giving me so much trouble. he can't help much. so i came here asking for help.

the errors are weird. they change time to time.

sometimes it shows media table error. which i fix by manually deleting media table and migrations table. or i am dropping the whole db. then migrate and then this media table error goes. but then this error comes. so i am not able to find where this error is coming from and where to edit the code of this. so i can change the table name and prevent the error from coming. thank you in advance though.

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: alter table `` add two_factor_secret text null after password, add two_factor_recovery_codes text null after two_factor_secret, add two_factor_confirmed_at timestamp null after two_factor_recovery_codes)

at C:\Users\Arya\Desktop\vy-master\vy-master\vendor\laravel\framework\src\Illuminate\Database\Connection.php:760 756▕ // If an exception occurs when attempting to run a query, we'll format the error 757▕ // message to include the bindings with SQL, which will make this exception a 758▕ // lot more helpful to the developer instead of just the database's errors. 759▕ catch (Exception $e) { ➜ 760▕ throw new QueryException( 761▕ $query, $this->prepareBindings($bindings), $e 762▕ ); 763▕ } 764▕ }

1 C:\Users\Arya\Desktop\vy-master\vy-master\vendor\laravel\framework\src\Illuminate\Database\Connection.php:539 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''")

2 C:\Users\Arya\Desktop\vy-master\vy-master\vendor\laravel\framework\src\Illuminate\Database\Connection.php:539 PDO::prepare("alter table `` add two_factor_secret text null after password, add two_factor_recovery_codes text null after two_factor_secret, add two_factor_confirmed_at timestamp null after two_factor_recovery_codes")

0 likes
2 replies
alonegamer's avatar

never mind i fixed it. going back and forth. learning new things daily. i was expecting this forum is more active in replying and helping but i guess i was wrong.

Snapey's avatar

@alonegamer Your question does not contain anything understandable to experienced forum lurkers.

sometimes it does this, and sometimes it does not and then I run this and then rub two sticks together and then mention the laravel spell but sometimes it just works...

1 like

Please or to participate in this conversation.