I have two almost identical queries on the same page, it looks like that:
/* Query to get total number of rows for pagination script*/
$query1 = mysql_query("SELECT * FROM '$table'
WHERE abc = '$abc'");
/* Top pagination */
include(getenv ("DOCUMENT_ROOT") . "/pagination.php");
/* Query to display results */
$query2 = mysql_query("SELECT * FROM '$table'
WHERE abc = '$abc'
LIMIT '$begin', '$limit'");
include(getenv ("DOCUMENT_ROOT") . "/display.php");
/* Bottom pagination */
include(getenv ("DOCUMENT_ROOT") . "/pagination.php");
Works fine but it seems a little redundant solution to me. So... is it possible to combine these two queries into one?
Maybe it's simple but being a PHP/MySQL newbie, i'm just unable to wrap my brains around it 🙁 TIA.