| | |
How to display result in a new line
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 8
Reputation:
Solved Threads: 0
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> </p>
</form>
</body>
</html>
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> </p>
</form>
</body>
</html>
![]() |
Other Threads in the PHP Forum
- Previous Thread: convert php/mysql page to html
- Next Thread: How to upload an image on page
Views: 1667 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





