I currently have 2 tables in my database. (will have 50 when site is complete) On the main page I will have a counter that shows the total number of records displayed on my site/in my database. I am currently able to display the number of rows in each table. I need for this number to be the total number of records in ALL tables in the database. Here is my current code.  Query:  // Query for recently added. Total # of rows in table resources $mysqli = new mysqli("localhost","root", "", "rnddb");  $query = $mysqli-&gt;prepare("SELECT * FROM `resources`"); $query-&gt;execute(); $query-&gt;store_result();  $recentlyadded = $query-&gt;num_rows;   Display:  &lt;?php echo $recentlyadded; // Total # of rows ?&gt;   As of right now this gives me back the total # of rows in the resources table. I need the query to run on all tables and give me back that number combined. Any help would be greatly appreciated! Thanks.
Is there a way to get the count of rows in all tables in a MySQL database without running a SELECT count() on each table?
Does $G\times K\cong H\times K$ imply $G\cong H$? JSON+Node.js - Unexpected token o Left-pad printf with spaces How can I pad a string with spaces on the left when using printf?  For example, I want to print "Hello" with 40 spaces preceding it.  Also, the string I want to print consists of multiple lines.  Do I need to print each line separately?  EDIT: Just to be clear, I want exactly 40 spaces printed before every line. Converting case of all values in all fields of table using ArcPy & Python? Which is correct, "neither is" or "neither are"? Bob: "Can I set the font color? Can I customize the text?"  Frank: "Neither of these options is available. Sorry!"    Is "neither is" always correct or should one use "neither are" in some cases and what are the exact rules?  of this-is-why-stackexchange-exists :P Sounds of the letter a How can I know, precisely, when to differentiate the sounds of the letter a, like in: apple and vault? How many RSA keys before a collision? How to change the desktop wallpaper to a photo of my own selection in Ubuntu 18.04? I'm not interested in downloading some wallpaper changer application, nor am I interested in coding something up. There has to be an easy way to select a photo as a custom wallpaper in Ubuntu 18.04. Where does YouTube's offline feature store video files? I'm using YouTube offline feature on my Android device, so that I can playback the offline videos within the YouTube app even there is no internet connection. When I searched for any of the video files, I can't find them on device/SD card memory. Are they encrypting the file so that it can be played only with YouTube app? Does anyone know the specific folder for offline video data? How to read an already existing NgSpice raw file This has taken me a couple of days to solve. I have a set of NgSpice raw files that I would like to exploit so as to visualize the voltage distributions in different circuits. What is the python command to use or python package to import in order for me to achieve this. Note: I am a bit familiar with the PySpice python package, but from what I have read and understood it works when you use it to create your netlist and run it, by using the already stored variables in its memory. In my case however, raw files are already generated... Hope I was clear enough. When writing answers on here, it's often necessary to create a new script and chmod +x it to make it executable. I won't go into whether this is a good thing or not, but explaining to people that they need to fire in three separate command (and teaching them to use nano!) is a bit of a waffle.  Is there anything easier? Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die Let $p$ be the probability that a man aged $x$ years will die in a year time.Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die?  The probability that a man aged $x$ years will die in a year time$=p$  The probability that a man aged $x$ years will not die in a year time$=1-p$  But from here on,i got stuck.Some hints and suggestions are welcome. Audits bug in the filtered review queue Just recently the . I've got  this morning which seems to be out of scope for my filtered list. I have filtered my list to only review VBA and Excel-VBA tags while the audit is tagged with perl http pipes which have nothing in common with VBA. I see a problem with the way the system currently works  Since I have a filtered list of tags, once I see a differently tagged question I already know it's an audit. Come on, that's too easy!  Can this please be fixed? update I have ran into  which I decided to edit - the question was tagged VBA and I thought it had nothing to do with VBA so I selected Edit which was the correct action. Now, once the first audit was clearly one to close - nothing to do with VBA and really easy to know that it actually was an audit - the second one was a very good audit. I am just thinking now if this is a proper bug or just a matter of malfunction in the system. I think the first one may have been made an audit for the wrong reason. Let's turn this into a discussion as I can't clearly work the system out. Verbatim Environment in Figure Caption Intuition for why the sum of Bernoulli trials is a sufficient statistic via cancellations on numerator and denominator? Suppose that $X_1, \ldots, X_n$ are iid Bernoulli trials with parameter $p$, and that $Y = \sum_{i=1}^nX_i$. Then, we have that $Y$ is a sufficient statistic by the following condensed proof:  $$ P(X_1 = x_1,  ... , X_n = x_n |Y = y) = \frac{p^y(1-p)^{n-y}}{\binom{n}{y}  p^y(1-p)^{n-y}} =\frac{1}{\binom{n}{y}}   \text{ if } \sum_{i=1}^{n}x_i = y $$  I am trying to see why this is the case. My reasoning is that there is some cancellation property on top and bottom that "kills" off the parameter $p$. In that whatever is on top through $p$ is perfectly matched by whatever is on the bottom minus scaling factors (in this case $\binom{n}{y}^{-1}$).   However, I am wondering what the deeper meaning behind this is, that the numerator of the joint distribution of the data and the sufficient statistic has its EXACT form on the bottom, except for constants which are only multiplicative (to facilitate cancellations). Am I onto something bigger and deeper here? Canon claims that EOS 6D has special capability to focus in low light, but it has only one cross-type sensor and overall only 11 focus points. Does only one cross-type focus point in the Canon EOS 6D affect its ability to focus in low light? Is it correct to assume that more cross-type focus points produce more accurate and sharper focus? How can I select first occurrence between two patterns including them. Preferably using sed or awk.  I have:  text something P1 something content1 content2 something P2 something text something P1 something content3 content4 something P2 something text   I want the first occurrence of the lines between P1 and P2 (including P1 line and P2 line):  something P1 something content1 content2 something P2 something If $a_0\in R$ is a unit, then  $\sum_{k=0}^{\infty}a_k x^k$ is a unit in $R[[x]]$ 'help' link is located lower than the other items It shows like this on Firefox 25 and Internet Explorer 11 (minus the red line of course):    Chrome seems to be fine. In the header of my document I set the maximal author names to 2:  \usepackage[style=authoryear-icomp, maxbibnames=9, maxcitenames=2, backend=biber]{biblatex}   Now, when I cite texts with two authors, LaTeX gives me the following:     (Author_A/ Author_B 2012: 232)   When I have three authors or more, LaTeX makes it:     (Author_A/ Author_B et al. 2012: 232)   But I want LaTeX to just name the first author if there are more than two authors ... like this:     (Author_A et al. 2012: 232)   Any tips on how to achieve this ?