Wow Web Designs Forums Home

Search
   
Members

Calendar

Help

Home
Search by username
Not logged in - Login | Register 
Wow Web Designs Forums > Scripting > PHP > Problem with spacing


Problem with spacing
 Moderated by: Aycan  

New Topic

Reply

Print
AuthorPost
reggiex
Member
 

Joined: Mon Oct 3rd, 2005
Location:  
Posts: 124
Status:  Offline
Mana: 
 Posted: Mon Feb 5th, 2007 03:08 pm

Quote

Reply
   hi, i have a problem with displaying the text from mysql database. I want the data from my database be displayed in a  certain format..for example, this message..
"hello people around the world" --- i want it to be displayed in this format...

hello
people around
the world

how will i do this?do i need to enter <br> into the database making "hello<br>people around<br>the world"? so it will be displayed as
hello
people around
the world


thanks...

GemX
Member
 

Joined: Fri May 25th, 2007
Location:  
Posts: 9
Status:  Offline
Mana: 
 Posted: Fri May 25th, 2007 09:24 pm

Quote

Reply
Well you can do this allso.
But i think that it is prety much easyer with adding <br> tag at db

here goes 1 of XXX possibilities

<?
#----- SQL QUERY -----# for " hello people around the world "
# text = mysql query result

$text_split =  explode(" ", $text);
  $output=$text_expl[0]."<br>".$text_expl[1].$text_expl[2]."<br>".$text_expl[3].$text_expl[4];

echo $output;
?>


But this is stupid to do... It is easyer to add <br> tag at database...


 Current time is 07:53 pm




Powered by WowBB 1.7 - Copyright © 2003-2006 Aycan Gulez
Page processed in 0.1457 seconds (10% database + 90% PHP). 16 queries executed.