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 "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.

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

  // 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))    

Please see it on line 3

  $ c = mysqli_fetch_assoc ($ cquery);   

You can also try this way,

  $ c = mysqli_fetch_array ($ cquery, MYSQLI_ASSOC);    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -