last day (14 days later) » 

1:13 PM
0
Q: ORDER function with PAGINATION together. PHP/MySQLi

DenisThis is my order list sortOrder.php: <?php $queryMain ="SELECT newsvid.id, newsvid.addName, newsvid.vidTitle, newsvid.vidType, newsvid.size, newsvid.url, newsvid.vidSD, newsvid.published, videoinformation.vidLD, videoinformation.vidYear, videoinformation.vidCity, videoinformation.vidZanr, video...

 
What exactly is the problem? you don't get results, error sql, something?!
 
The problem is... pagination is working fine but when I use ORDER list it's not working.... BUT order list is working if I delete pagination...
 
If you do a var_Dump($queryMainList) and you take that result and paste it in mysql admin panel? What does that give you?
 
string(470) "SELECT newsvid.id, newsvid.addName, newsvid.vidTitle, newsvid.vidType, newsvid.size, newsvid.url, newsvid.vidSD, newsvid.published, videoinformation.vidLD, videoinformation.vidYear, videoinformation.vidCity, videoinformation.vidZanr, videoinformation.vidZanr2, videoinformation.vidZanr3, videoinformation.vidQuality, videoinformation.vidTranslated, videoinformation.vidTime FROM newsvid, videoinformation WHERE newsvid.id = videoinformation.id AND approved='1'LIMIT 0,2"
 
Run that SQL through your database.. And see what that returns.. (prob error)
 
1:13 PM
nicely display only two result as expected
 
If it displays the result as it should in your DB, then you should also get the right results on your page? do a var_dump($row) or a var_dump(mysqli_fetch_array($resultDisplay, MYSQLI_ASSOC));
 
I get the right result...BUT when I start use the SORT method, display for example only year 2014, nothing happens.. the URL changed correctly to this one.. example.net/…
BUT nothing happens
 
you don't have a SORT method..
you mean ORDER BY?
 
Ye.. order BY
sortOrder.php
 
1:30 PM
well var_Dump your query using ORDER BY
and then run your query in your DB
(there was no order by in your last query..)
 
I fix a few issues
SELECT newsvid.id, newsvid.addName, newsvid.vidTitle, newsvid.vidType, newsvid.size, newsvid.url, newsvid.vidSD, newsvid.published,
videoinformation.vidLD, videoinformation.vidYear, videoinformation.vidCity, videoinformation.vidZanr, videoinformation.vidZanr2, videoinformation.vidZanr3, videoinformation.vidQuality, videoinformation.vidTranslated, videoinformation.vidTime
FROM newsvid, videoinformation WHERE newsvid.id = videoinformation.id AND approved='1' AND newsvid.vidType ='Cartoon'" string(621) "SELECT newsvid.id, newsvid.addName, newsvid.vidTitle, newsvid.vidType, newsvid.size, newsvid.url, newsvid.vidSD, newsvid.published, videoinformation.vidLD, videoinformation.vidYear,
videoinformation.vidCity, videoinformation.vidZanr, videoinformation.vidZanr2, videoinformation.vidZanr3, videoinformation.vidQuality, videoinformation.vidTranslated, videoinformation.vidTime FROM newsvid, videoinformation WHERE newsvid.id = videoinformation.id AND approved='1' AND newsvid.vidType ='Cartoon' AND
I get another issue
Ok
string(496) "SELECT newsvid.id, newsvid.addName, newsvid.vidTitle, newsvid.vidType, newsvid.size, newsvid.url, newsvid.vidSD, newsvid.published, videoinformation.vidLD, videoinformation.vidYear, videoinformation.vidCity, videoinformation.vidZanr, videoinformation.vidZanr2, videoinformation.vidZanr3, videoinformation.vidQuality, videoinformation.vidTranslated, videoinformation.vidTime
FROM newsvid, videoinformation WHERE newsvid.id = videoinformation.id AND approved='1' ORDER BY newsvid.id DESC LIMIT 0,2"
In SQL working fine, but on website do not order at all
 
1:46 PM
If it works in your admin panel
the results you get should be the same...
 
yes it's works
 
if your query works
 
on website URL changed but ...no effect on ordering
 
there is soemthing wrong when you get the data
or do something with the data
 
may be ...I have not idea and here where I'm stuck
I can show full code
 
1:52 PM
does: var_dump(mysqli_fetch_array($resultDisplay, MYSQLI_ASSOC)); give you your results you are expecting??
 
yes
 
2:08 PM
then I don't understand the reason it is not showing you the items onscreen that you are asking...
 

last day (14 days later) »