View Full Version : Updating Text From A MySQL DataBase ?

12-24-2007, 10:35 PM

I want to every second change the text that is displaid to what I have in my MySQL database using PHP. How on earth do I do this?

So far I have got..

<script type="text/javascript">

function updateMessage ( )
//This will load something like the time, mot saying I will use that query
$message = mysql_query("SELECT * FROM message WHERE username='admin'");
document.getElementById("message").firstChild.nodeValue = "<?php echo "$message"; ?>";

// -->
<body onload="updateMessage(); setInterval('updateMessage()', 1000 )">
<span id="message"><?php echo "$message"; ?></span>

I am very greatful for any help you can give me, please note I MUST use PHP and MySQL.