I am beginner in PHP, I was trying to display the poems which are stored in the database(mysql) to the website with php code, the problem is that the poem is showing as a paragraph....how can I display the poems the way I wanted, like line by line
micahgeorge
0
Newbie Poster
Recommended Answers
Jump to Posthi,
exactly i don't know how you want to display the poembut hope it will help you
first start the query
$query = "select * from tbl_poem";
$result = mysql_query($query) or die('Error in query!<br />'.mysql_error());// now going to fetch all the result
while($row = …
Jump to Posthello micahgeorge,
can you please write down your insert query here so that understand how you send the data and also tell me which data type you stored in db like blob or text??
Jump to Postfirst depend on you how you insert the data on database
try this also
while($row = mysql_fetch_array($result)) { echo nl2br($row['poem']); echo '<hr>'; }
let me know
All 9 Replies
jogesh_p
6
Junior Poster in Training
micahgeorge
0
Newbie Poster
jogesh_p
6
Junior Poster in Training
micahgeorge
0
Newbie Poster
jogesh_p
6
Junior Poster in Training
micahgeorge
0
Newbie Poster
jogesh_p
6
Junior Poster in Training
micahgeorge
0
Newbie Poster
jogesh_p
6
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.