I am trying to perform a query and am getting the following error..
7Error: No index used in query/prepared statement SELECT `id`, `category_id`, `topic_id`, `post_creator`, `post_content`, `post_date` FROM forum_posts WHERE `category_id`=? AND `topic_id`=?
I originally had this line of code for it...
if($stmt2 = $con->prepare("SELECT * FROM forum_posts WHERE `category_id`=? AND `topic_id`=?")) {
So I tried changing it to the following to give it an index.
if($stmt2 = $con->prepare("SELECT `id`, `category_id`, `topic_id`, `post_creator`, `post_content`, `post_date` FROM forum_posts WHERE `category_id`=? AND `topic_id`=?")) {
Why would this error be occuring? I have php error reporting on.
error_reporting(E_ALL);
ini_set('display_errors', 1);
However, even when I comment it out, the error still occurs and it kills my code. Anyone know why this error is coming up and how I can fix it?