title: Is there a way to auto refresh a variable on a php code without reloading the page?
body: <p>I have a PHP file with a form and a variable that gets the total numbers of posts from mySQL.</p>
  
  <p>$number shows the result of the SQL query. The total number is useful to me because I use a form and I submit the number also. In the period that I complete the form, the number may change at anytime because a user has submitted a new post during this period. That means the number I send is wrong.</p>
  
  <p>I thought of a solution that reloads a part of the php code and it will work great for me.
  I am not a PHP specialist for very advanced solutions, so any ideas and examples are welcome.</p>