php - pdo mysql select statement working on one table while it is not working on other


I am having a strange problem. I am using PDO prepared statement.

I have two tables with the name of TABLE1 AND TABLE2. TABLE1 is copied from another db with its data. TABLE2 is created using phpmyAdmin, Both Tables are in the same Database.

I am running a Select statement using PDO prepare and its working fine on TABLE1 (which is copied from another DB) while it is not working on TABLE2 (which is created using phpmyadmin). No error and No exception. Strange?

does PDO prepare statement requires any specific type of table? or another setting which i don't know?




I find the solution myself. actually pdo requires fully qualified name to access table which was created using phpmyadmin.

so run the select statement using Following queries.

SELECT * FROM DB1.TABLE2 (successfully return the result set)

While I can access my Copied table (TABLE1) from another database without using DB1.

SELECT * FROM TABLE1 (successfully return the result set)


People are also looking for solutions to the problem: default keyword in php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.