For some reason, my code wont let me update my database. I know i am connected to proper database with the proper credentials. I have a button that lets me delete a whole row but my update button wont work!. I just want it so that when a user hits Update, itll update the database. There are three files that you may need to look at someone please help!
network.html
<?php include("nameFunctions.php"); include("dbcon.php"); $sql = "SELECT ix, network FROM networkelements GROUP BY network;"; $result = mysql_query($sql) or die (mysql_error()); echo "Please select a Network from the list - must choose at least one!
"; echo ""; while ($row = mysql_fetch_array($result)) { echo "$row[network]"; } echo "" ; echo ""; echo "
"; if ($_POST[submit]){ if (!empty($_POST[nets])){ ?>
<div id='table1'>
<?php
echo "Update Network | Network | Zone | Vendor | Element | T1 Manager | T2 Manager | T3 Manager | T4 Manager | Config Manager | Capacity Manager | Current Planning | Eng Manager | Fnp Manager |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" . $link . " | "; echo "" . $row['network'] . " | "; echo "" . $row['zone'] . " | "; echo "" . $row['vendor'] . " | "; echo "" . $row['element'] . " | "; $s = $row['t1manager']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['t2manager']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['t3manager']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['t4manager']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['configmgr']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['capacitymgr']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['currentplng']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['engmanager']; $s1 = multinametree($s); echo "" . $s1 . " | "; $s = $row['fnpmanager']; $s1 = multinametree($s); echo "" . $s1 . " | "; echo "
updateTool.html
<?php include("dbcon.php"); $ix = $_REQUEST['ix']; $sql = "SELECT * FROM networkelements where ix=" . $ix . " order by ix;"; print ""; print ""; print ""; print "Update Tool"; print ""; print ""; print ""; print "";
print $menu;
print "Modify Item | |
Item | Value | "; print "
"; print "Network"; print " | "; print ""; print ""; print " | "; print "
"; print "Zone"; print " | "; print ""; print ""; print " | "; print "
"; print "Vendor"; print " | "; print ""; print ""; print " | "; print "
"; print "Element"; print " | "; print ""; print ""; print " | "; print "
"; print "Tier 1 (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Tier 2 (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Tier 3 (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Tier 4 (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Configuration Manager (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Capacity Manager (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Current Planning Manager (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Engineering Manager (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print "Fundamental Network Planning Manager (attid1; attid2; attid3...)"; print " | "; print ""; print ""; print " | "; print "
"; print " "; print " | "; print "";
print "";
//print "-- Update This Record --";
$net = $_REQUEST['net'];
print " -- Delete This Record --"; print " | ";
print "
uupdateTool.html
<? include("dbcon.php"); $ix = $_REQUEST['ix']; $net = $_REQUEST['net']; $q = " UPDATE networkelements SET "; $q .= "network = '" . addslashes(trim($_REQUEST['network'])) . "', "; $q .= "zone= '" . addslashes(trim($_REQUEST['zone'])) . "', "; $q .= "vendor= '" . addslashes(trim($_REQUEST['vendor'])) . "', "; $q .= "element= '" . addslashes(trim($_REQUEST['element'])) . "', "; $q .= "t1manager= '" . addslashes(trim($_REQUEST['t1manager'])) . "', "; $q .= "t2manager= '" . addslashes(trim($_REQUEST['t2manager'])) . "', "; $q .= "t3manager= '" . addslashes(trim($_REQUEST['t3manager'])) . "', "; $q .= "t4manager= '" . addslashes(trim($_REQUEST['t4manager'])) . "', "; $q .= "configmgr= '" . addslashes(trim($_REQUEST['configmgr'])) . "', "; $q .= "capacitymgr= '" . addslashes(trim($_REQUEST['capacitymgr'])) . "', "; $q .= "currentplng= '" . addslashes(trim($_REQUEST['currentplng'])) . "', "; $q .= "engmanager= '" . addslashes(trim($_REQUEST['engmanager'])) . "', "; $q .= "fnpmanager= '" . addslashes(trim($_REQUEST['fnpmanager'])) . "', "; $q .= " WHERE ix='" . $ix . "' limit 1"; print $q; $resutlt = mysql_query($q); print $result; header("Location: network.html?net=$net"); mysql_close($con); ?>My index.html is just a webpage with different links to tools