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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.