0

Below code is used to create a payment form.

Everything works fine but problem is in supplier-ID dropdown.

Drop down is created but does not fetch data from mysql table and also shows no error.

<html>
<head>
</head>
<body bgcolor="Silver">

<form name="info" action="payment.php" method="post"><br />
<h3><b>Payment</b></h3><br/>

Payment Date<br/>
<input type="date" name="paymt_dt" /><br />
Payment#<br/>
<input type="text" name="paymt_no" maxlength="6"/><br />
Supplier ID<br />
<select name="sup_id">
<?php
    include_once 'func.inc.php';
    connect();
$sql="select sup_id,sup_name from supplier ";
$result = mysql_query($sql);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<option value="<?php echo $line['sup_id'];?>"> <?php echo $line['sup_name'];?> </option>

<?php
}
?>
</select><br />

Payment Mode<br />
<select name="pmt_mod">
    <option value="Cash">Cash</option>
    <option value="Cheque">Cheque</option>
    <option value="DD">DD</option>
    <option value="Payord">Pay Order</option>
</select><br />
Document#<br/>
<input type="text" name="doc_no" maxlength="15"/><br />
Document Date<br/>
<input type="date" name="doc_dt" /><br />
Amount<br />
<input type="number" name="amount" maxlength="10" /><br />
Remarks<br/>
<textarea id="txt1" name="remarks" maxlength="100" rows="4" cols="50">Type your comments here</textarea><br /><br />

<input type="submit" value="Submit!"/>
</form>
</body>
</html>
Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56

1 Answers1

0

Use mysqli instead. and in while loop

while($line = mysqli_fetch_assoc($result)){
 // rest of the code }
TylerH
  • 20,799
  • 66
  • 75
  • 101
SoftwareDev
  • 336
  • 2
  • 13