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
Try to use "echo" instead of "print"...
Log in to post a comment.
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
Try to use "echo" instead of "print"...