Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Php/Mysql live update
10-16-2009, 12:06 PM #1
- Join Date
- May 2009
- Glastonbury, UK
- Thanked 0 Times in 0 Posts
Php/Mysql live update
Ok so i hope I have got this in the right catagory because it is kinda cross language coding...
What I need is a piece of text to be live on the page.
For instance, there are currently x users in our database.
I have this so far which displays the amount of users
We currently have
$username = "user";
$password = "pass";
$host = "localhost";
$database = "users";
$table = "users";
mysql_connect($host,$username,$password) or die("Error connecting to Database! " . mysql_error());
mysql_select_db($database) or die("Cannot select database! " . mysql_error());
$result = mysql_query("SELECT * FROM $table");
$num_rows = mysql_num_rows($result);
echo ($num1_rows + $num_rows); ?> users!
Thanks in advance,