Php not showing data randomly

All the queries for the bank table must use the same WHERE … clause, so that they match and operate on the same set of data.

The common part of the query, starting with the FROM term, any JOINs, any WHERE clause, any GROUP BY clause, and any HAVING clause should be built once, in a php variable, then that variable should be used when building any sql query that needs it.

You also have a logical mistake in the above. One = is assigning 1 to $page, then testing the result of the assignment, which will always be true. Two == is a comparison operator.

All the logic and the query to get the starting total up to the requested page of data, doesn’t even belong inside the loop that’s outputting the data. It belongs before the query that gets the requested page of data.

I recommend that you first define what you need each section of code to do. What inputs, if any, there are, what processing you are gong to do based on those inputs, and what result you are going to produce or output. Include these definitions as comments in the code, then design, write, test, and debug the code/query(ies) needed for each section, one section as a time.

Also, don’t copy variables to other variables for nothing. This is just a waste of typing. Use the original variables the data is in.

sorry for my late reply, i checked this before itself!

Sponsor our Newsletter | Privacy Policy | Terms of Service