Forum Moderators: coopster
[edited by: eelixduppy at 8:58 pm (utc) on Jan. 17, 2009]
[edit reason] removed URL [/edit]
Since the URL that you posted isn't allowed here on the boards, would you mind describing in words what it is you would like your data to look like and we'll see if we can't get this working for you. :)
<?php
// Connects to your Database
mysql_connect("localhost", "user", "password") or die(mysql_error()) ;
mysql_select_db("mwzzzcyg_news") or die(mysql_error()) ;
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM index_news ORDER BY pid DESC") or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array( $data ))
{
//Outputs the image and other data
Echo "<img src=http://www.example.com/newsite/News/".$info['photo'] ."> <br>";
Echo "<b></b> ".$info['header'] . "<br> ";
Echo "<b></b> ".$info['description'] . " <br>";
}
?>
$data = mysql_query("SELECT * FROM index_news ORDER BY pid DESC") or die(mysql_error());
?>
<table>
<?php
while($info = mysql_fetch_array($data)) {
?>
<tr>
<td><?php echo $info['photo']); ."<br />" ?>
<?php echo $info['header']); ."<br />" ?>
<?php echo $info['description']); ."<br />" ?>
<hr />
</td>
</tr>
<?php
}
?>
</table>
my code now looks like
<?php
// Connects to your Database
mysql_connect("localhost", "user", "password") or die(mysql_error()) ;
mysql_select_db("mwzzzcyg_news") or die(mysql_error()) ;
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM index_news ORDER BY pid DESC") or die(mysql_error());
?>
<table>
<?php
while($info = mysql_fetch_array($data)) {
?>
<tr>
<td><?php echo $info['photo']); ."<br />" ?>
<?php echo $info['header']); ."<br />" ?>
<?php echo $info['description']); ."<br />" ?>
<hr />
</td>
</tr>
<?php
}
?>
</table>
td><?php echo $info['photo'] ."<br />"; ?>
<?php echo $info['header'] ."<br />"; ?>
<?php echo $info['description'] ."<br />"; ?>
Also the brackets need to go.
I think this change should resolve your issue. Let us know how it works.