Jump to content

[SOLVED] Displaying count result on webpage


torrentmasta

Recommended Posts

hi, im a noob to all this and im trying make a counter on my webpage that shows registered users.

 

$result = mysql_query("SELECT COUNT(user) from mytable");

 

echo "$result";

 

How do i get to output the proper result counter in the echo statment, i apologize for such noobiness.

 

I tried to use fetch function to get the data but in not sure how to do it right.

 

 

Torrentmasta

I went deeper into your forums and found the answers i was looking for

 

$count = mysql_query("SELECT count(user) FROM websitedata", $con);

 

echo "Total Registered Members: ". mysql_result($count, 0, 0);

 

dang, that was an easy fix, im such a noob, lol

 

Well thx to your great forums i found the answers

 

HAIL PHPFREAKS!!!

 

Torrentmasta

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.