How in WordPress can I count the number of sql query lines? I know that you can make Select and then $ wpdb-> num_rows But if no data is needed in the sample, can you just find out the number of lines? Or should you always do a sample of any value to be calculated?

  • one
    do $ wpdb-> num_rows - it seems superfluous, than did not please SELECT COUNT (*), what? Well, yes, this is not related to PCP and WordPress, your question is purely in sql. - test123
  • 2
    Question about what? About your custom query, or a query formed by WordPress for WP_Query? If the second, then there is a request for half a page, and it returns the number of lines always - KAGG Design
  • @ test123 That's just about SELECT COUNT (*) and did not know, thanks =). - Gagablik
  • @ test123, if the question concerns the VP, then you do not need harmful tips on how to climb into the database. Well, this calculation will not do anything terrible and may even give the correct result (which is unlikely, but possible), but in general it is not necessary. - SeVlad
  • @SeVlad, >> you don't need any bad advice about how to climb into the base << o_O, this is not bad advice, but SQL documentation. Or "how to declare a field" in OOP is also bad advice for you? If a framework using SQL can somehow break the base or execute the documented code described by the standard, come up with another option that doesn’t comply with this standard, do you think “bad advice” is to blame? - test123

0