I am trying to pull inv_no from a database and print it in a text box. I use this code on other pages that just display on a page, but never used it on a form with text boxes. What am I doing wrong. This is php with mysql.
<form name="sv_t4.php" method="post" action=<?php echo $PHP_SELF;?>>
<?php
if (isset($_POST['cbovessel']))
{
$inv_ch=$_POST['cbovessel'];
}
$query="Select * from tbl_vessel where inv_no=$inv_ch;";
$result_set = pg_Exec ($conn, $query);
$rows = pg_NumRows($result_set);
for($i=0;$i<$rows;$i++)
{
$_POST['invno']=pg_result($result_set, $i,"inv_no");
}
?>
<table width="100%" border="0">
<tr>
<td width="17%">Inventory Number </td>
<td width="27%"><input name="inv_no" type="text" value="<?=$_POST['invno'];?>" size="10" />
</font> </p>