Page 2 of 2

Posted: Thu Mar 18, 2004 1:33 pm
by Illusionist
Joe wrote:Yes Illusionist i did actually see that code and i tried it. The only problem is that it worked far worse than the original.
... I really don't believe that...

Posted: Thu Mar 18, 2004 1:59 pm
by RobertGonzalez
Try this:

Code: Select all

<?php
	$link = mysql_connect("???", "???", "???"); 
	if ( !@mysql_select_db("???") )
	{
		die("couldnt connect " . mysql_error()); 
	}

	$sql = "SELECT * FROM news ORDER BY ID"; 
	if ( !($result = @mysql_query($sql)) )
	{
		die("<p>Sorry, there was a problem: " . mysql_error() ."</p>");
	}

	while ( $row = mysql_fetch_array($result)  )
	{
		
		echo "<img src='news.gif' border=1>"; 
		echo "<br><u><b>.:" . $row['headline'] . ":.</U></b> posted by " . $row['username'] . "<br>"; 
		echo $row['mainnews']."<br>"; 
		echo "<hr color='white'>"; 
	} 

	mysql_close($link); 

?>
It looked like in your code you sort of changed the value of $row midstream. See if the code above helps.