943,682 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4145
  • PHP RSS
Apr 13th, 2008
0

How to display result in a new line

Expand Post »
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>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ash112 is offline Offline
8 posts
since Apr 2008
Apr 13th, 2008
0

Re: How to display result in a new line

seems like your new to HTML too...

do you mean they display on the same line after you've submitted the form or what?
Reputation Points: 13
Solved Threads: 7
Junior Poster
kevindougans is offline Offline
110 posts
since Oct 2007
Apr 13th, 2008
0

Re: How to display result in a new line

yes after i'v submitted the form. And i want it too display in a new line not the same.

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ash112 is offline Offline
8 posts
since Apr 2008
Apr 13th, 2008
0

Re: How to display result in a new line

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?
Reputation Points: 13
Solved Threads: 7
Junior Poster
kevindougans is offline Offline
110 posts
since Oct 2007
Apr 15th, 2008
0

Re: How to display result in a new line

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...
Reputation Points: 10
Solved Threads: 1
Light Poster
upstream is offline Offline
43 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: convert php/mysql page to html
Next Thread in PHP Forum Timeline: How to upload an image on page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC