How to display result in a new line

Reply

Join Date: Apr 2008
Posts: 8
Reputation: ash112 is an unknown quantity at this point 
Solved Threads: 0
ash112 ash112 is offline Offline
Newbie Poster

How to display result in a new line

 
0
  #1
Apr 13th, 2008
Hi i am new to php. The code below is a page that display results from the database. i included a table. When the search result displays the result it doesnt go on a new line. For example the name neil Mcman and Peter Worth comes in the same line. I want it to go to a new line. for eg

Neil Mcmarn

Peter worth

Any help will be much apreciated

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="welcome.php" method="post">
<?
$username="proper_asik112";
$password="ashik112";
$database="proper_contacts";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>

<select name="name" id="name">

<?php
$sql="SELECT id,first FROM contacts";
$result =mysql_query($sql);
while ($data=mysql_fetch_assoc($result)){
?>
<option value ="<?php echo $data['id'] ?>" ><?php echo $data['first'] ?></option>
<?php } ?>

</select>
<br>
Mobile :
<input name="mobile" type="text" id="mobile">
</p>
<p>
<input type="submit" value="Submit" name="Submit"/>
</p>
<p>&nbsp; </p>
</form>
</body>
</html>
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 38
Reputation: kevindougans is an unknown quantity at this point 
Solved Threads: 1
kevindougans kevindougans is offline Offline
Light Poster

Re: How to display result in a new line

 
0
  #2
Apr 13th, 2008
seems like your new to HTML too...

do you mean they display on the same line after you've submitted the form or what?
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 8
Reputation: ash112 is an unknown quantity at this point 
Solved Threads: 0
ash112 ash112 is offline Offline
Newbie Poster

Re: How to display result in a new line

 
0
  #3
Apr 13th, 2008
yes after i'v submitted the form. And i want it too display in a new line not the same.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 38
Reputation: kevindougans is an unknown quantity at this point 
Solved Threads: 1
kevindougans kevindougans is offline Offline
Light Poster

Re: How to display result in a new line

 
0
  #4
Apr 13th, 2008
you've posted the wrong bit of code, you need to post the bit of code that looks at the form AFTER it's been submitted... welcome.php?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 32
Reputation: upstream is an unknown quantity at this point 
Solved Threads: 1
upstream's Avatar
upstream upstream is offline Offline
Light Poster

Re: How to display result in a new line

 
0
  #5
Apr 15th, 2008
if you want to display a result in a new line
use this "\n" on your php code (if you just want a clear view of your list in loop..or <br /> tags in html...
Programming = new Art
---
I <3 BoA Kwon
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum


Views: 1667 | Replies: 4
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC