php - If I have the an id how to know in which page number? -


डेटाबेस में तालिका

  आईडी 1 2 4 30 31 ...   

पृष्ठ पर अंक लगाना

  प्रति पृष्ठ 2 पंक्ति है, desc   

अगर मेरे पास id = 30 पता है कि किस पृष्ठ संख्या में पता है? किसी भी सुझाव की सराहना की जाएगी

पहले उसका आदेश प्राप्त करें:

  select तालिका (_) से गिनती (*) जहां आईडी & lt; = 30 आदेश द्वारा col_name;   

फिर आंकड़ा पृष्ठ संख्या:

  int आदेश = 27; // पिछले क्वेरी से परिणाम, पृष्ठ int = 10; इंट पेजनम = ऑर्डर / पेजसिझ + + (ऑर्डर% pageSize == 0? 0: 1); // यहाँ पृष्ठ नंबर 1 से शुरू, नहीं 0,    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -