Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  agyat : (23 May 2013 - 01:23 AM) Wow! Mr. Sb Back Home.
@  OpaQue : (23 May 2013 - 12:44 AM) Ting
@  OpaQue : (24 April 2013 - 02:44 PM) I guess, Time to run Mycent script.
@  OpaQue : (24 April 2013 - 02:43 PM) wow.. not much spam. except habatt posting lot of links.. :P
@  yordan : (23 April 2013 - 01:04 PM) You're welcome, agyat. Nice to have been helpful. Second lesson: try full words, "you" instead of "EW".
@  agyat : (23 April 2013 - 05:03 AM) @YORDAN: tHANK EW FOR YOUR FIRST LESSON.   :D
@  yordan : (22 April 2013 - 09:43 PM) @agyat : "why don't you help me", or "please help me", or "please teach us"
@  yordan : (22 April 2013 - 09:42 PM) welcome back, velma
@  velma : (22 April 2013 - 07:51 AM) **yawns** Good to be back, wonder what is going on here :)
@  agyat : (22 April 2013 - 03:50 AM) Oh! so, why don't help me learn english..
@  yordan : (21 April 2013 - 08:38 PM) The goal mentioned by shiu : "learning english, learning computer"
@  agyat : (21 April 2013 - 06:31 PM) WHAT GOAL?
@  yordan : (20 April 2013 - 10:39 AM) yes, that's our goal. simultaneouly learning English and teaching/learning computer using.
@  shiyu : (20 April 2013 - 07:30 AM) learning english,learning computer
@  yordan : (19 April 2013 - 01:11 PM) Oh, I see, it's just a trick in order to force people looking at your texte. Somehow smart, maybe.
@  agyat : (19 April 2013 - 02:54 AM) And of course I know it is not SEO friendly.
@  agyat : (19 April 2013 - 02:52 AM) There may be two possible answers for that ....


1) Shout was posted using mobile keypad.

2) To force people read content carefully and/or with more concentration.
@  agyat : (19 April 2013 - 02:49 AM) There may be two possible answers for that ....
@  yordan : (18 April 2013 - 09:35 PM) however, why this mixing of capital letters in the middle of your text?
@  agyat : (18 April 2013 - 11:10 AM) false feelings.

Replying to How To: Display A Members/user List.


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

Posted 02 September 2010 - 06:25 AM

how to list how many users are login in phpHow To: Display A Members/user List.

hi  I am creating a chat system 

there is 2 problems

1). How to show the list of login users in php using database...

2).How to open differnent windows in same link

for example

lets 1st user is chatting I want the second user go for chat it open a new window

Thanks in advance!

-reply by kamal

 


Posted 29 July 2010 - 11:05 AM

Displaying user listHow To: Display A Members/user List.

 Till now the Article is nice...

But my requirement is that entries have to be displayed in Html text boxes and the modifications done here r to be reflected in the Database...

can u please help me regarding this...The database table and the Html page should be in synchronization...

-reply by anki

 


Posted 14 April 2009 - 10:18 PM

Great GuideHow To: Display A Members/user List.

I have tryingfor 3 days to find a way to display only certain fields in my Joomla User database as and address book. I had already modified the registration script and the database itself to include phone numbers and such, but did not know enough about php/mysql to display them as a list, while excluding other information in the table.Your guide worked perfectly. Thank you!!

-reply by Jason

 


Feelay

Posted 22 August 2008 - 06:41 AM

lol xD this is too basic :D I didn't understand because it was sooo basic :o
haha ;) almost kidding ;) this is very basic ^.^ haha, making it fit with my login/register scripts :mellow: Cool :P

Archimedes

Posted 28 July 2008 - 01:27 AM

Thank you, Yordan, I plan to have many more tutorials in the future! xD

yordan

Posted 26 July 2008 - 10:53 AM

Nice tutorial, Archimedes. I appreciate the way you use simple words in order to explain rather complicated things (using php to make queries into the database and displaying the results on the screen). Lucky strike for a first tuto, I hope that you will continue this way.
Regards
Yordan

Archimedes

Posted 26 July 2008 - 01:02 AM

Alright, some of you might want to display your User's or Members on your site.

Notes:
1.This is to fit in with Feelay's register and Log-in scripts you can find in the tutorial section.
2.I made this to show the members of my site who is a member and what their ID is.



First off, we must set up a connection to our MySQL Database.
<?php
$con = mysql_connect("localhost","database_username","database_username_password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
What it does:
1.It is starting a PHP document.
2.Next it sets up a connection to the database with the members table.
3.Change 'database_username' to your database username.
4.Change 'database_username_password' to your username's password.

Next, we select the database the information is stored at using the 'mysql_select_db() function.
mysql_select_db("userbase_name", $con);
What it does:
1.All it is doing is selecting a database using the connection in the first part of code.

For the next part, we will be selecting the table in which the members info is stored at, whereas the table is named 'members'.
And you want to order them by ID.
$result = mysql_query("SELECT * FROM members ORDER BY ID");
What it does:
1.The '$result', is just a variable, so you don't have to type the function again.
2.It is selecting everything '*', from the table members and ordering it by the user's ID.

For the third part, we will be creating a HTML table to display the user information.
echo "<table border='0'>
<tr>
<th>UserName</th>
<th>ID</th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['UserName'] . "</td>";
  echo "<td>" . $row['ID'] . "</td>";
  echo "</tr>";
  }
echo "</table>";
What it does:
1.You can can change the '0' in the <table border=''> tag to anything you chose.
2.The '<th>User Name</th>'&'<th>ID</th>' tags are the top of the table.
3.The 'while() function is creating an array, whereas '$row' is a variable to shorten your work, instead of typing the mysql_fetch_array() function out again.
4.The 'echo "<td>" . $row['UserName'] . "</td>";' & ' echo "<td>" . $row['ID'] . "</td>";' is just selecting the info from the table to be displayed, whereas the user/members name is stored in the column 'UserName' and the ID is stored under 'ID'.

Ending your document.
mysql_close($con);
?>
What it does:
1.It is closing the connection we made in the first part of this tutorial.
2.It is closing the <?php tag in the first part of code of this tutorial.

The Output
User Name ID
User1 1
User2 2
User3 3
User4 4
etc. etc.


That's it!
Any questions, feel free to ask.
This is my first tutorial on Astahost forums.

Review the complete topic (launches new window)