I'm guessing that your question is that you aren't getting the data from the database?
If so, it looks like your missing a line of code that reads the information your getting from the query.
I believe that this is what it should look like...
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';
$db = 'base';
$conn = mysql_pconnect($dbhost,$dbuser,$dbpass);
mysql_select_db($db, $conn);
$result = mysql_query("SELECT * FROM mbblog ORDER BY id DESC");
$mbblog = mysql_fetch_assoc($result);
$news = $mbblog['short_news'];
mysql_close($conn);
?>
And if you wanted it to automatically update (say every 5 seconds) you could use AJAX, simply place the code above on an external page making sure it echo
s your $news
variable, and using a JavaScript loop, update the content of a <div>
using AJAX to call the content of the external page every time the loop runs.
That would work something like this...
window.setInterval(function get()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","LOCATION_OF_CODE.php?session=" + Math.random(),true);
xmlhttp.send();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("ELEMENT_TO_DISPLAY_CONTENT").innerHTML=xmlhttp.responseText;
}
}
}, 5000);
So for your marquee code, you would place a <div>
tag inside the <marquee>
and give it an ID to link to the AJAX.
Hope this helps!