Friday, 27 February 2015

PHP Script for Dynamic Drop down List

(1)create table   account:


create table account
(
id  int(5) primary key auto_increment,
name  varchar(20),
contact  varchar(20),
address  varchar(200),
emailid  varchar(20),
account   varchar(20),
password   varchar(20),
image      varchar(200),
idproof     varchar(200),
addressproof varchar(200));

(2)insert some values  into table
(3) then use following code :


<html>
<head>
<title>
Deposit money
</title>
</head>

<body>
<form   >
<select name=account>
<?php

include("connect.php");

$sql="select * from account";

$result=mysql_query($sql);

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

echo '<option value="'.$row['id'].'">';

echo $row['id'];

echo '</option>';

}

?>
</select>
<form>
</body>
</html>

No comments:

Post a Comment