I have 2 pages, but nothing is getting inserted into the database. What am I doing wrong?
Page 1
<form action=sv_t3.php method="post">
<table width="100%" border="0">
<tr>
<td width="17%">Inventory Number </td>
<td width="27%"><input name="inv_no" type="text" id="inv_no" maxlength="50"></td>
<td width="20%">SV Type</td>
<td width="36%"><input name="sv_type" type="text" id="sv_type" maxlength="50"></td>
</tr>
<tr>
<td>SV Name </td>
<td><input name="sv_name" type="text" id="sv_name"></td>
maxlength="50"></td>
</tr>
<tr>
<input name="submit" type="submit" value="submit">
</td>
<td> </td>
</tr>
</table>
</form>
Page 2
<?php include("../ccdsv/dbconn3.php");
/ This script inserts sacred vessel information into the sacred vessels database /
//a simple wrapper to reduce the code needed
//for each postgres query
function query($sql) {
global $db;
return pg_exec($db,$sql);
}
$inv_no = $GET['inv_no'];
$sv_type = $GET['sv_type'];
$sv_name = $_GET['sv_name'];
$sql="INSERT INTO tbl_vessel ( inv_no, sv_type, sv_name )
values ('$inv_no', '$sv_type', '$sv_name')";
pg_exec ($db, $sql);
/** END of section to insert into the table **/
?>