Jump to content

Recommended Posts

i have a code where the elements of a dvd shud be viewd not in a line but with new lines when the user views the elements...

 

<?php

 include('session.php');
 include('session_check.php');
?>



<?php

include('database.php');
       
       if(isset($_SESSION['user_name']))

{               
 $session=$_SESSION['user_name'];	 

 $sql1="select * from user_table where  user_name like '%$session%' ";

 $result1=mysql_query($sql1);

 $row1=mysql_fetch_array($result1);

 $id=$row1['id'];

$sql="select * from dvd_info where user_id like '%$id%' ";

$result=mysql_query($sql);

while($row=mysql_fetch_array($result))
{      
       

        echo "Dvd Name : ".$row['dvd_name']; 
	echo"</br>";

                $array=array();
   
	$array=split(",",$row['contents']);
    
                $size=count($array);
	echo   "Contents:";
                for($i=0;$i<$size;$i++)
        {
                        
                        echo   $array[$i];

	} 
	//echo " Contents :".$row['contents'];
	echo "<br /><br />";

        }
        

}

?>

<form action="home.php" method="post">

<center> 
<input type="submit" value="Home" >
</center>

 

here the contents come up in a line...how can i seperate each content by new line/? by the way i hav asked the users to enter the contents when they save them separateing by ENTER.

Link to comment
https://forums.phpfreaks.com/topic/200346-how-to-make-new-lines/
Share on other sites

tnx bro it seems to work but the contents now comes up in a messd way...like this

 

Dvd Name : ANdalibs dvd

Contents:hey

i

seem

to

like

u

 

i want it to come up like:

 

Dvd Name : ANdalibs dvd

 

Contents:hey

                i

                seem

                to

                like

                u

how can i do that? and can i sumhow make it and unorderd list??

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.