Hi, on my site ( i am using a news poster by geting the info from a MySQL database.
But my code doesn't seem to be working.
Check!!
//code//
<?php
$host = "host"; //host
$user = "user"; //user
$pass = "pword"; //password
$db = "dbase"; //MySQL database
$load = $_GET['p'];
$conn = mysql_connect($host, $user, $pass);
mysql_select_db($db, $conn);
$query = mysql_query("SELECT * FROM newsposter ORDER by 'date' DESC"
;
while ($r = mysql_fetch_array($query)) {
$title = $r["title"];
$news = $r["news"];
$posted = $r["date"];
$postedby = $r["postedby"];
echo(<center><table width=385 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=385 height=23 class=headings background=images/pages/topbottom.gif>
<div align=center>$title</div></td>
</tr>
<tr>
<td height=23 class=headings background=images/pages/middle.gif>
<div align=center>$news</div></td>
</tr>
<tr>
<td height=23 bgcolor=#FFFFFF class=headings background=images/pages/topbottom.gif>
<div align=center>$postedby
$posted</div></td>
</tr>
</table><center>);
}
?>
The bits in RED are the bits I want displayed on teh screen. At the moment they just say $title etc
Help!!
Thanx
Martin
But my code doesn't seem to be working.
Check!!
//code//
<?php
$host = "host"; //host
$user = "user"; //user
$pass = "pword"; //password
$db = "dbase"; //MySQL database
$load = $_GET['p'];
$conn = mysql_connect($host, $user, $pass);
mysql_select_db($db, $conn);
$query = mysql_query("SELECT * FROM newsposter ORDER by 'date' DESC"

while ($r = mysql_fetch_array($query)) {
$title = $r["title"];
$news = $r["news"];
$posted = $r["date"];
$postedby = $r["postedby"];
echo(<center><table width=385 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=385 height=23 class=headings background=images/pages/topbottom.gif>
<div align=center>$title</div></td>
</tr>
<tr>
<td height=23 class=headings background=images/pages/middle.gif>
<div align=center>$news</div></td>
</tr>
<tr>
<td height=23 bgcolor=#FFFFFF class=headings background=images/pages/topbottom.gif>
<div align=center>$postedby
$posted</div></td>
</tr>
</table><center>);
}
?>
The bits in RED are the bits I want displayed on teh screen. At the moment they just say $title etc
Help!!
Thanx
Martin