Lots of questions. :-)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Lots of questions. :-)

Post by nick2 »

OK I got Registering, Logging in, set cookies.. and each page is protected by cookies.. ok now its time for messaging system, users online, and Members page. :(

I've been posting alot of threads because of this script i'm making ^_^

Ok well I have some question I hope you might be able to answer:

1: Messaging system, How. Do I use a database to store the messages? - if so How do I know what user to send to? I do have a ID stored in database. :/

2: Members page, anyone know how to list certain database tables on a page?

3: Members online, when you login should I make it send your id to a text file then echo that text file on the main page? and when you logout it deletes your id? I dunno help please!

I know this is alot but it would be appreciated greatly!

I basicly need guidlines!

Thanks again,
Nick
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post by nick2 »

not one of you can give me some tips? :(


please! 8O
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

You are looking too far ahead of yourself...take a book read the basics... take an opensource project see how they do it... then look into sessions, and in time you will find the answers to your questions... what you asked is what people have learned with months of practice and head bangings over the desk...i've been through that...

It gets easier one you get through the basics...
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Re: Lots of questions. :-)

Post by McGruff »

nick2 wrote:2: Members page, anyone know how to list certain database tables on a page?

Code: Select all

<?php
$mysql = "SELECT name FROM members ORDER BY name";
$query = mysql_query($mysql) or die(mysql_error() . '<br />');

// $query is a result resource. Mysql_fetch functions fetch an array of values one row at a time. If you have multiple rows, use a while loop:

while($result = mysql_fetch_array($query))
{
    $name = stripslashes($result['name']);
    echo $name . '<br />';
}

?>
Last edited by McGruff on Thu Aug 11, 2005 12:02 am, edited 2 times in total.
Caped Knight
Forum Commoner
Posts: 33
Joined: Wed Jan 01, 2003 6:20 pm
Location: Somewhere...out there...

Post by Caped Knight »

Get PHP & MySQL for Dummies.
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

McGruff,
I think he meant
$mysql = "SHOW TABLES from myDataBase";

>3: Members online, when you login should I make it send your id to a text file then echo that text file on the main page? and when you logout it deletes your id? I dunno help please!

How about you just echo the id?
Post Reply