Please I have this problem on my script, It is just pulling the data from the postgresql database but does not place it in the dropdown field created for it on the html form.
What can possibly be wrong with this script? I have three different forms on this script and just trying to get one to run perfectly
What can possibly be wrong with this script? I have three different forms on this script and just trying to get one to run perfectly
Code:
<html> <head><title>UG Pipeline Fiedl Data Capture</title> </head> <body> <--HTML Code to create the data entry form--> <p> </form></P> <form action="<?php echo $PHP_SELF; ?>" method="post"> <table width="600" cellpadding= "10" cellspacing="1" border="2"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1" bgcolor="#64b1ff"> <h3>Input Field Tally Information</h3> Select Pipe No:<select pipeno ="" pipeno ="" > <option value=""> --- Select --- </option></select> Select Wall Thickness:<select wellthickness ="" wallthickness ="" > <option value=""> --- Select --- </option></select> <br><br> Input Joint No: <input type="text" name="jointno"> Input measured Length: <input type="text" name="measuredlength"><br><br> Input Serial No: <input type="text" name="serialno"><br><br> <input type="Submit" name="submit" value="Submit"> <?php //Php Code to connect to postgresqldatabase $PGHOST = "localhost:25376"; $PGDATABASE = "Pipeline"; $PGUSER = "postgres"; $PGPASSWORD = "Casa2009"; $PGPORT = 5432; $db_handle = pg_connect("dbname=$PGDATABASE user=$PGUSER password=$PGPASSWORD"); if ($db_handle) { echo 'Connection attempt succeeded.'; } else { echo 'Connection attempt failed.'; } // Code to pull data from the database and load onto the form echo "<br />\n"; $query = 'select * from fieldtally order by pipeno asc '; $result = pg_query($db_handle,$query); while ($row = pg_fetch_row($result)) { //print ("<option> $row[0]</option>"); } ?> </form></P> <--Creating a secod form--> <form action="fieldbend.php" method="post"> <table width="600" cellpadding="10" cellspacing="1" border="2"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1" bgcolor="#ff9d9d"> <h3>Input Field Bend Information</h3> Select Pipe No:<select pipeno ="" pipeno ="" > <option value=""> --- Select --- </option></select> Select Wall Thickness:<select wellthickness ="" wallthickness ="" > <option value=""> --- Select --- </option></select> <br><br> Input Measured Distance: <input type="text" name="measureddistance"> Input Bend Angle: <input type="text" name="benddegree"><br><br> Input Bend Type: <input type="text" name="bendtype"><br><br> <input type="Submit" name="submit" value="Submit"> </form></P> <form action="apptally.php" method="post"> <table width="600" cellpadding="10" cellspacing="0" border="2"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1" bgcolor="#66CC66"> <h3>Input App. Tally Information</h3> Input Type: <input type="text" name="type"> Input Serial No: <input type="text" name="serialno"><br><br> Input Reference ID: <input type="text" name="referenceid"><br><br> <input type="Submit" name="submit" value="Submit"> </form></P> </form> </body> </html>
Comment