Page 1 of 1

Line breaks...what am i missing

Posted: Wed 11. Aug 2004, 22:58
by kpimichael
I wanted to write a quick piece of code to list article summaries to include as article content... so i did this....

Code: Select all

[PHP]
$db = mysql_connect('localhost','user_name','password') or die("Error while trying to connect to host");

mysql_select_db('table',$db) or die("Error while trying to connect to database");

$sql = "SELECT * FROM phpwcms_article ORDER BY article_id";

if($result = mysql_query($sql, $db)) {
    echo "<br>";
    while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
	extract ($row ,'OVERWRITE');	
        echo "this is an article summary ".$article_id."<br>";
        echo $article_summary."<br>";
    }
mysql_free_result($result);
}
[/PHP]
in a content type "html". I intended to put it on one page to summarize all articles for example. Everything quick and dirty with me :) It works fine but will not do line breaks... I have tried everyway i could think of...but still dont get it to break. I tried with Firefox and Explorer both and neither will do the line break. Any ideas of why a "<br>" will not work? Even more important. How to get around it :) Thanks in advance

Posted: Thu 12. Aug 2004, 01:07
by pSouper
i would have thought

Code: Select all

echo "<br>";
would do fine but...
did you try [BR] (the phpWCMS replacment tag)

Your are a genius

Posted: Thu 12. Aug 2004, 01:46
by kpimichael
The tag worked... buy doing echo "[BR]" I just dont know why the <br> does not work. I do not have this problem in doing a <br> when i use {PHP:my_external.php} only the [PHP] ... i assume that it is architectural in the way that oliver puts it all together. I can't find it though.

Posted: Thu 12. Aug 2004, 10:21
by pSouper
I have not noticed having any trouble using "<br>" though have not tested for it specifically.