php - SQL - select id where id is not in array -
I want to select from a table after the last 12 news. I tried but there was no result. I got undefined $ news
public function get_all_news_home () {$ news = array (); # Nectum la bas de date $ the-> load-> Database (); #CheapSize $ top_news_query = $ this- & gt; Db- & gt; Query ("Choose where * from the selection = 1 and ready = 'wi' order date from DESC limit 4 '); $ Last_news = $ this-> db-> query ($ last_news_query); $ Last_news = ( $ last_news-> num_rows ())? $ last_news- & gt; result_are (): null; foreign currency ($ last_news as $ ln) {array_push ($ news, array ('id' = & gt; $ ln ['id']))} $ All_news = $ this-> gtc-> if ($ all_news-> num_rows ()) {$ all_news = $ all_news-> result_re ();} and {$ all_news = NULL;} Return to $ all_news;} Please help me. How can I remove the first 4 id
< P> Try it out: ... $ newsIds = implode (',', array_values ($ news)) ... ... $ all_news = $ this- & gt; db- News from 'Select' (where you do not have a News ID ('$ NewsEds') date from the DESC limit of 12 "); ... < / html>
Comments
Post a Comment