General Error 1 No Such Table
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Sqlstate Hy000 General Error 1 No Such Column
Discuss the workings and policies of this site About Us Learn sqlite no such table more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us php artisan migrate Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Can't find table (SQLSTATE[HY000]: General error: 1 no such table: users) up vote 0 down vote favorite I'm trying to insert into a table, but it cannot find the table users. I get the error posted in the title. The table most definitely exists: This is how I am connecting: define("DB_DSN", "sqlite2:host=hosthere;dbname=dbnamehere"); define("DB_USERNAME", " "); define("DB_PASSWORD", " "); $con = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD); $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "INSERT INTO users(username, password) VALUES(:username, :password)"; I am using a free website host so I can't really edit much besides .htaccess. It has sqlite and sqlite2. I tried with sqlite:host... but I still get same error. I'm still new to PDO and would appreciate any help. php sqlite pdo share|improve this question edited Jan 16 '14 at 18:46 jszobody 20.1k52954 asked Jan 16 '14 at 18:45 m.o 391418 IS dbname actually dbnamehere? –david strachan Jan 16 '14 at 19:21 No, I just took it out for this post. Didn't think it was important, but it's yayu_zxq_users. –m.o Jan 16 '14 at 19:36 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Your connection string doesn't appear to be correct. There are no "host" and "dbname" variables for connecting to an SQLite database. An SQLite databa
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Got “General error: 1 no such table: player” when table `player` exists up vote 0 down vote favorite I've create http://stackoverflow.com/questions/21170251/cant-find-table-sqlstatehy000-general-error-1-no-such-table-users a database with sqlite, and added a table player $ sudo vendor/bin/doctrine orm:schema-tool:update --dump-sql CREATE TABLE player (id INTEGER NOT NULL, username VARCHAR(50) NOT NULL, PRIMARY KEY(id)); Verified that the table exists $ sqlite3 database SQLite version 3.8.5 2014-08-15 22:37:57 Enter ".help" for usage hints. sqlite> .tables player sqlite> But when i DQL to player table $entityManager = EntityManager::create(); $query = $entityManager->createQuery( "SELECT p FROM Player p where p.username = :username" ); $query->setParameter('username', http://stackoverflow.com/questions/33333511/got-general-error-1-no-such-table-player-when-table-player-exists $_POST['username']); $player = $query->getResult(); I always receive the message ( ! ) Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 no such table: player' in ... /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php on line 58 php sqlite doctrine2 share|improve this question asked Oct 25 '15 at 18:39 sensorario 2,60732554 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged php sqlite doctrine2 or ask your own question. asked 11 months ago viewed 188 times Related 578How do I check in SQLite whether a table exists?0Doctrine - General error: 1395 Can not delete from join view1SQL errors when attempting to test Symfony 2 app - columns already exist, tables missing1How to generate SQL for single Doctrine table?-1Application deploy a Symfony Application in Filezilla?2symfony Error: Expected =, <, <=, <>, >, >=, !=, got '.'0Symfony 2 not loading database config file0Doctrine Console error SQLSTATE[08006] [7] FATAL: Ident authentication failed for user “SYSTEMUSER”