Line breaks...what am i missing

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
kpimichael
Posts: 44
Joined: Mon 29. Dec 2003, 03:29

Line breaks...what am i missing

Post 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
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

i would have thought

Code: Select all

echo "<br>";
would do fine but...
did you try [BR] (the phpWCMS replacment tag)
Last edited by pSouper on Thu 12. Aug 2004, 10:20, edited 1 time in total.
kpimichael
Posts: 44
Joined: Mon 29. Dec 2003, 03:29

Your are a genius

Post 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.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

I have not noticed having any trouble using "<br>" though have not tested for it specifically.
Post Reply