简体   繁体   中英

Database name in Wordpress / PDO error reporting

I apologize in advance if this turns out to be a stupid question, but I've been racking my brain for an hour already.

I normally work in PHP with Laravel, but now I've been plunged into a project that uses a Wordpress database and a custom framework which uses PDO queries directly from the controller (no models exist); I need help figuring something out since I'm very inexperienced in Wordpress and PDO.

The client gave me a link to a database named simb2317419733 , it has a Wordpress structure and the prefix is wp_wd5t1y9832_ .

However, the queries on the site seem to reference tables that don't exist in this database. For example, the following query is trying to insert into a table named answers but:

1) no such table exists in the database 2) no error is thrown

Here is the query info:

http://pastebin.com/n08LnFbK

Notice that all the info matches the database above (host, user, password, prefix) but the database name itself is just wordpress . Is this a normal occurrence in Wordpress, or is this a case of the client simply giving me the wrong database which happens to have the same prefix? Or is the answers table missing but PDO isn't reporting the error for some reason?

Check that plugin how it creates the connection to database. There are two options: or it connects to the same database like the whole worpdress using constants from wp_config file, or there is plugin configuration, where you can provide different connection details. It can be either set in wp admin panel or some config files... But if you figure out, that it is using the same database, then there are two options. As you said, you've received wrong information. The second: plugin is not installed and it hasn't set up its tables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM