Menu

Help on printing from c_messages (MySQL query

Help
Anonymous
2002-06-19
2012-09-14
  • Anonymous

    Anonymous - 2002-06-19

    Hi,

    I am new to MySQL, but I have tried to make a script that prints out a page with the data in the 'c_messages' from the database.

    The script below does not print every message out on a new line.
    HOW can that be done:

    <?php
    $connection = mysql_connect("",
                                 "",
                                 "");
    mysql_select_db("", $connection);
    ?>

    <?php
      $result = mysql_query("select username, message
                             from c_messages");
      while ($row = mysql_fetch_array($result)) {
        print "$row[username] $row[message]";
      } 
    ?>

    Best regards
    Damon Coward

     
    • Henning Schaefer

      Try to use "echo" instead of "print"...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.