php - mysqli_query() returns empty results for full table -
I am creating a page that asks a question for all the columns of all results in descending order with a threshold The entry is in accordance with the time when I query for the counting of the rows, the query works fine, but when I ask for a table again for the data, I do not get anything. I decided to try to harvest the query on The query is failing because the result of mysqli_query () is incorrect and when I query phpMyAdmin, the query works. A small piece of my code below Please see it on line 3 You can also try this way, "SELECT * FROM comments" , but whenever
"SELECT COUNT (*) is calculated from the comments" . I have tried to use mysqli_error (), but he has not given me any information.
// open database need_once ($ root. "Database / data.php"); // Get the number of suggestions in the comment table $ cquery = mysqli_query ($ cbase, "SELECT COUNT (*) as calculated from the comments"); // This works $ c = mysqli_fetch_array ($ cquery); $ Count = $ c ["count"]; // Receive all the suggestions // This query fails from $ queryText = "SELECT * comments order time DESC LIMIT". (($ Page - 1) * $ pageLimit) ",". $ PageLimit; $ Query = mysqli_query ($ cbase, $ queryText); // Validate query if ($ query === incorrect) {$ failed = true; } // When receiving all comments from the query (! $ Failed & $ array = mysqli_fetch_array ($ result))
$ c = mysqli_fetch_assoc ($ cquery);
$ c = mysqli_fetch_array ($ cquery, MYSQLI_ASSOC);
Comments
Post a Comment