Miscellaneous

  Home arrow Miscellaneous arrow Page 2 - Mini-Chat Tutorial
MISCELLANEOUS

Mini-Chat Tutorial
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 17
    2002-07-24

    Table of Contents:
  • Mini-Chat Tutorial
  • Basic Printing
  • Improving
  • Final Script

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Mini-Chat Tutorial - Basic Printing


    (Page 2 of 4 )

    Now we need a way of printing messages, so we write a simple function that may be called anywhere we want the chat to be printed. It simply get the messages out of the DB in the order they have come in, and print them:

    <?php
    // Prints messages
    function printMessages() {
       
    $rs mysql_query"SELECT * FROM MINICHAT ORDER BY ITSTIME LIMIT 0,10" );

       while ( 
    $msg mysql_fetch_array$rs )) {
          echo 
    $msg['LOGIN']." &gt;".$msg['MESSAGE']."&lt;br&gt;";
       }
    }
    ?>

    That's enough to mini-chat.

    More Miscellaneous Articles
    More By Codewalkers

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap