I want to add a new line and when I tried "/n", it did not work.

`while($row_selecttemptable = mysql_fetch_array($result_selecttemptable))

          echo $row_selecttemptable['ArtistName'] . ' ,' . $row_selecttemptable['NAMEOfTheDVD'];`

I want to add a new line between ArtistName and Name of The DVD

Recommended Answers

Newline in HTML is <br> tag (a break):

echo $row_selecttemptable['ArtistName'] . ' ,<br>' . $row_selecttemptable['NAMEOfTheDVD'];`
Jump to Post

And if you wish to simply print text with a newline in it, it's \n, not /n.

Jump to Post

All 7 Replies

Newline in HTML is <br> tag (a break):

echo $row_selecttemptable['ArtistName'] . ' ,<br>' . $row_selecttemptable['NAMEOfTheDVD'];`

And if you wish to simply print text with a newline in it, it's \n, not /n.

Member Avatar

As both above but \n will only work when in double quotes - not single quotes. Single quotes will output the literal backslash and n.

Thank You very much, for all your respones. I would just like to add that the "\n" did not work(for me), but the br did.

Thanks You.

Member Avatar

As a follow up - "\n" will show up correctly if you're prettifying your html output (view source in the browser).

Well. it only put a space but it did not actually go to a newline

Member Avatar

Well. it only put a space but it did not actually go to a newline

\n won't show in general browser view, only in view source or in a textarea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.