New Posts  All Forums:Forum Nav:

PHP & MySQL issue

post #1 of 24
Thread Starter 
I'm so close to getting this to work. I have everything working now except for one minor (hopefully) issue. I have an html table display the data from a mysql database. At the end of each line I have an Edit button, that button then should pass the ID to the edit php script. It does display an edit form in table format which is how I have it designed but when I click one Edit button it brings up the whole mysql table. The display form is a php script that executes edit.php when one of the edit buttons is clicked.

display.php
Code:
<?php

// connection stuff is here

$result = mysql_query("SELECT * FROM Items");
echo '<form action="edit_form.php" method="post">';

// table and form stuff is here

echo "<td><input name=\"update\"  type=\"submit\" value=\"Edit\"</td></tr>";


edit.php
Code:

// connection stuff

$query = ("SELECT * FROM Items WHERE id = id") or die("Unable to search ID: " . mysql_error());

// table headers

while($row = mysql_fetch_array($result)) {

// table containing data -- everything from here out works fine.

Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #2 of 24
In your form, add a field:
Code:
<input type="hidden" id="id" value="{ID of thing to edit}" />

Then in edit.php
Code:
/* IMPORTANT: REMEMBER TO ESCAPE USING MYSQL_REAL_ESCAPE_STRING() AND SANITIZE INPUT! */

// connection stuff

$query = ("SELECT * FROM Items WHERE id = {$_POST['id']}") or die("Unable to search ID: " . mysql_error());

// table headers

while($row = mysql_fetch_array($result)) {

// table containing data -- everything from here out works fine.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #3 of 24
Thread Starter 
my edit now has
Code:
$query = ("SELECT * FROM Items WHERE id = {$_POST['id']}") or die("Unable to search ID: " . mysql_error());

display has
Code:
echo "<td><input type=\"hidden\" id=\"id\" value=\"{$row['id']}\"/></td>";

when I run it I get:

SELECT * FROM Items WHERE id = You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line

it's not sending the id still?
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #4 of 24
Quote:
Originally Posted by Iggy0828 View Post

my edit now has
Code:
$query = ("SELECT * FROM Items WHERE id = {$_POST['id']}") or die("Unable to search ID: " . mysql_error());
display has
Code:
echo "<td><input type=\"hidden\" id=\"id\" value=\"{$row['id']}\"/></td>";
when I run it I get:
SELECT * FROM Items WHERE id = You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line
it's not sending the id still?

Put the following code in edit.php and post the output
Code:
echo "SELECT * FROM Items WHERE id = {$_POST['id']}";
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #5 of 24
Thread Starter 
This is what I got

SELECT * FROM Items WHERE id = Query was empty
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #6 of 24
Quote:
Originally Posted by Iggy0828 View Post

This is what I got
SELECT * FROM Items WHERE id = Query was empty

Can you post the output of this, too:
Code:
var_dump( $_POST );

And in display.php, post the output of:
Code:
var_dump( $row );
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #7 of 24
Thread Starter 
display.php
Code:
array(152) { [0]=> string(1) "4" ["id"]=> string(1) "4" [1]=> string(1) "0" ["soditemid"]=> string(1) "0" [2]=> string(1) "0" ["Tier"]=> string(1) "0" [3]=> string(8) "Test1234" ["ItemName"]=> string(8) "Test1234" [4]=> string(1) "0" ["AC"]=> string(1) "0" [5]=> string(1) "0" ["STR"]=> string(1) "0" [6]=> string(1) "0" ["STA"]=> string(1) "0" [7]=> string(1) "0" ["DEX"]=> string(1) "0" [8]=> string(1) "0" ["AGI"]=> string(1) "0" [9]=> string(1) "0" ["CHA"]=> string(1) "0" [10]=> string(1) "0" ["WIS"]=> string(1) "0" [11]=> string(1) "0" ["INT"]=> string(1) "0" [12]=> string(1) "0" ["HP"]=> string(1) "0" [13]=> string(1) "0" ["Mana"]=> string(1) "0" [14]=> string(1) "0" ["MR"]=> string(1) "0" [15]=> string(1) "0" ["FR"]=> string(1) "0" [16]=> string(1) "0" ["CR"]=> string(1) "0" [17]=> string(1) "0" ["PR"]=> string(1) "0" [18]=> string(1) "0" ["DR"]=> string(1) "0" [19]=> string(1) "0" ["FT"]=> string(1) "0" [20]=> string(1) "0" ["CS"]=> string(1) "0" [21]=> string(1) "0" ["MS"]=> string(1) "0" [22]=> string(1) "0" ["SR"]=> string(1) "0" [23]=> string(1) "0" ["DmgR"]=> string(1) "0" [24]=> string(1) "0" ["Aggr"]=> string(1) "0" [25]=> string(1) "0" ["SpellWard"]=> string(1) "0" [26]=> string(4) "None" ["Instrument"]=> string(4) "None" [27]=> string(1) "0" ["InstrumentMod"]=> string(1) "0" [28]=> string(0) "" ["BaneType"]=> string(0) "" [29]=> string(1) "0" ["BaneDmg"]=> string(1) "0" [30]=> string(0) "" ["SkillMod"]=> string(0) "" [31]=> string(1) "0" ["SkillModAmt"]=> string(1) "0" [32]=> string(0) "" ["FocusEffect"]=> string(0) "" [33]=> string(0) "" ["SpellEffect"]=> string(0) "" [34]=> string(1) "0" ["WeaponDmg"]=> string(1) "0" [35]=> string(1) "0" ["WeaponDly"]=> string(1) "0" [36]=> string(0) "" ["WeaponType"]=> string(0) "" [37]=> string(1) "0" ["earslot"]=> string(1) "0" [38]=> string(1) "0" ["neckslot"]=> string(1) "0" [39]=> string(1) "0" ["headslot"]=> string(1) "0" [40]=> string(1) "0" ["faceslot"]=> string(1) "0" [41]=> string(1) "0" ["chestslot"]=> string(1) "0" [42]=> string(1) "0" ["backslot"]=> string(1) "0" [43]=> string(1) "0" ["armslot"]=> string(1) "0" [44]=> string(1) "0" ["shoulderslot"]=> string(1) "0" [45]=> string(1) "0" ["wristslot"]=> string(1) "0" [46]=> string(1) "0" ["waistslot"]=> string(1) "0" [47]=> string(1) "0" ["handslot"]=> string(1) "0" [48]=> string(1) "0" ["fingerslot"]=> string(1) "0" [49]=> string(1) "0" ["legslot"]=> string(1) "0" [50]=> string(1) "0" ["feetslot"]=> string(1) "0" [51]=> string(1) "0" ["prislot"]=> string(1) "0" [52]=> string(1) "0" ["secslot"]=> string(1) "0" [53]=> string(1) "1" ["rangeslot"]=> string(1) "1" [54]=> string(1) "1" ["ammoslot"]=> string(1) "1" [55]=> string(1) "1" ["charmslot"]=> string(1) "1" [56]=> string(1) "0" ["aug2slot"]=> string(1) "0" [57]=> string(1) "0" ["aug3slot"]=> string(1) "0" [58]=> string(1) "0" ["aug5slot"]=> string(1) "0" [59]=> string(0) "" ["mob"]=> string(0) "" [60]=> string(1) "1" ["brdclass"]=> string(1) "1" [61]=> string(1) "0" ["bstclass"]=> string(1) "0" [62]=> string(1) "0" ["clrclass"]=> string(1) "0" [63]=> string(1) "1" ["druclass"]=> string(1) "1" [64]=> string(1) "0" ["encclass"]=> string(1) "0" [65]=> string(1) "0" ["magclass"]=> string(1) "0" [66]=> string(1) "1" ["mnkclass"]=> string(1) "1" [67]=> string(1) "0" ["necclass"]=> string(1) "0" [68]=> string(1) "0" ["palclass"]=> string(1) "0" [69]=> string(1) "0" ["rngclass"]=> string(1) "0" [70]=> string(1) "0" ["rogclass"]=> string(1) "0" [71]=> string(1) "0" ["shdclass"]=> string(1) "0" [72]=> string(1) "0" ["shmclass"]=> string(1) "0" [73]=> string(1) "0" ["warclass"]=> string(1) "0" [74]=> string(1) "0" ["wizclass"]=> string(1) "0" [75]=> string(12) "Array(notes)" ["notes"]=> string(12) "Array(notes)" }

edit_form.php
Code:
array(1) { ["update"]=> string(4) "Edit" }
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #8 of 24
Quote:
Originally Posted by Iggy0828 View Post

display.php
Code:
array(152) { [0]=> string(1) "4" ["id"]=> string(1) "4" [1]=> string(1) "0" ["soditemid"]=> string(1) "0" [2]=> string(1) "0" ["Tier"]=> string(1) "0" [3]=> string(8) "Test1234" ["ItemName"]=> string(8) "Test1234" [4]=> string(1) "0" ["AC"]=> string(1) "0" [5]=> string(1) "0" ["STR"]=> string(1) "0" [6]=> string(1) "0" ["STA"]=> string(1) "0" [7]=> string(1) "0" ["DEX"]=> string(1) "0" [8]=> string(1) "0" ["AGI"]=> string(1) "0" [9]=> string(1) "0" ["CHA"]=> string(1) "0" [10]=> string(1) "0" ["WIS"]=> string(1) "0" [11]=> string(1) "0" ["INT"]=> string(1) "0" [12]=> string(1) "0" ["HP"]=> string(1) "0" [13]=> string(1) "0" ["Mana"]=> string(1) "0" [14]=> string(1) "0" ["MR"]=> string(1) "0" [15]=> string(1) "0" ["FR"]=> string(1) "0" [16]=> string(1) "0" ["CR"]=> string(1) "0" [17]=> string(1) "0" ["PR"]=> string(1) "0" [18]=> string(1) "0" ["DR"]=> string(1) "0" [19]=> string(1) "0" ["FT"]=> string(1) "0" [20]=> string(1) "0" ["CS"]=> string(1) "0" [21]=> string(1) "0" ["MS"]=> string(1) "0" [22]=> string(1) "0" ["SR"]=> string(1) "0" [23]=> string(1) "0" ["DmgR"]=> string(1) "0" [24]=> string(1) "0" ["Aggr"]=> string(1) "0" [25]=> string(1) "0" ["SpellWard"]=> string(1) "0" [26]=> string(4) "None" ["Instrument"]=> string(4) "None" [27]=> string(1) "0" ["InstrumentMod"]=> string(1) "0" [28]=> string(0) "" ["BaneType"]=> string(0) "" [29]=> string(1) "0" ["BaneDmg"]=> string(1) "0" [30]=> string(0) "" ["SkillMod"]=> string(0) "" [31]=> string(1) "0" ["SkillModAmt"]=> string(1) "0" [32]=> string(0) "" ["FocusEffect"]=> string(0) "" [33]=> string(0) "" ["SpellEffect"]=> string(0) "" [34]=> string(1) "0" ["WeaponDmg"]=> string(1) "0" [35]=> string(1) "0" ["WeaponDly"]=> string(1) "0" [36]=> string(0) "" ["WeaponType"]=> string(0) "" [37]=> string(1) "0" ["earslot"]=> string(1) "0" [38]=> string(1) "0" ["neckslot"]=> string(1) "0" [39]=> string(1) "0" ["headslot"]=> string(1) "0" [40]=> string(1) "0" ["faceslot"]=> string(1) "0" [41]=> string(1) "0" ["chestslot"]=> string(1) "0" [42]=> string(1) "0" ["backslot"]=> string(1) "0" [43]=> string(1) "0" ["armslot"]=> string(1) "0" [44]=> string(1) "0" ["shoulderslot"]=> string(1) "0" [45]=> string(1) "0" ["wristslot"]=> string(1) "0" [46]=> string(1) "0" ["waistslot"]=> string(1) "0" [47]=> string(1) "0" ["handslot"]=> string(1) "0" [48]=> string(1) "0" ["fingerslot"]=> string(1) "0" [49]=> string(1) "0" ["legslot"]=> string(1) "0" [50]=> string(1) "0" ["feetslot"]=> string(1) "0" [51]=> string(1) "0" ["prislot"]=> string(1) "0" [52]=> string(1) "0" ["secslot"]=> string(1) "0" [53]=> string(1) "1" ["rangeslot"]=> string(1) "1" [54]=> string(1) "1" ["ammoslot"]=> string(1) "1" [55]=> string(1) "1" ["charmslot"]=> string(1) "1" [56]=> string(1) "0" ["aug2slot"]=> string(1) "0" [57]=> string(1) "0" ["aug3slot"]=> string(1) "0" [58]=> string(1) "0" ["aug5slot"]=> string(1) "0" [59]=> string(0) "" ["mob"]=> string(0) "" [60]=> string(1) "1" ["brdclass"]=> string(1) "1" [61]=> string(1) "0" ["bstclass"]=> string(1) "0" [62]=> string(1) "0" ["clrclass"]=> string(1) "0" [63]=> string(1) "1" ["druclass"]=> string(1) "1" [64]=> string(1) "0" ["encclass"]=> string(1) "0" [65]=> string(1) "0" ["magclass"]=> string(1) "0" [66]=> string(1) "1" ["mnkclass"]=> string(1) "1" [67]=> string(1) "0" ["necclass"]=> string(1) "0" [68]=> string(1) "0" ["palclass"]=> string(1) "0" [69]=> string(1) "0" ["rngclass"]=> string(1) "0" [70]=> string(1) "0" ["rogclass"]=> string(1) "0" [71]=> string(1) "0" ["shdclass"]=> string(1) "0" [72]=> string(1) "0" ["shmclass"]=> string(1) "0" [73]=> string(1) "0" ["warclass"]=> string(1) "0" [74]=> string(1) "0" ["wizclass"]=> string(1) "0" [75]=> string(12) "Array(notes)" ["notes"]=> string(12) "Array(notes)" }
edit_form.php
Code:
array(1) { ["update"]=> string(4) "Edit" }

Wow that's weird.
Time to see some code... can we see both files in the full form please smile.gif
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #9 of 24
Thread Starter 
ok. i'm fairly new so excuse my formatting smile.gif

display.php
Warning: Spoiler! (Click to show)
Code:
<?php
$con = mysql_connect("localhost", "username", "password");
if (!$con) {
        die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_name",$con);
$result = mysql_query("SELECT * FROM Items");
echo '<form action="edit_form.php" method="post">';
echo '<table border="2" width="5000" cellspacing="0" cellpadding="3">';
echo "<tr>";
echo '<th width="8">DBID</th>';
echo '<th width="12">SoD Item ID</th>';
echo '<th width="4">Tier</th>';
echo '<th width="255">ItemName</th>';
echo '<th width="4">AC</th>';
echo '<th width="4">STR</th>';
echo '<th width="4">STA</th>';
echo '<th width="4">DEX</th>';
echo '<th width="4">AGI</th>';
echo '<th width="4">CHA</th>';
echo '<th width="4">WIS</th>';
echo '<th width="4">INT</th>';
echo '<th width="4">HP</th>';
echo '<th width="4">Mana</th>';
echo '<th width="4">MR</th>';
echo '<th width="4">FR</th>';
echo '<th width="4">CR</th>';
echo '<th width="4">PR</th>';
echo '<th width="4">DR</th>';
echo '<th width="6">FT</th>';
echo '<th width="6">CrtStr</th>';
echo '<th width="6">MdShld</th>';
echo '<th width="6">StnRes</th>';
echo '<th width="6">DmgRed</th>';
echo '<th width="6">Aggr</th>';
echo '<th width="6">SplWrd</th>';
echo '<th width="12">Instrument</th>';
echo '<th width="6">InsMod</th>';
echo '<th width="12">BaneType</th>';
echo '<th width="6">BneDmg</th>';
echo '<th width="12">SkillMod</th>';
echo '<th width="6">ModAmt</th>';
echo '<th width="255">FocusEffect</th>';
echo '<th width="255">SpellEffect</th>';
echo '<th width="6">WpnDmg</th>';
echo '<th width="6">WpnDly</th>';
echo '<th width="6">WpnTyp</th>';
echo '<th width="6">Ear</th>';
echo '<th width="6">Neck</th>';
echo '<th width="6">Head</th>';
echo '<th width="6">Face</th>';
echo '<th width="6">Chest</th>';
echo '<th width="6">Back</th>';
echo '<th width="6">Arms</th>';
echo '<th width="6">Shldrs</th>';
echo '<th width="6">Wrist</th>';
echo '<th width="6">Waist</th>';
echo '<th width="6">Hands</th>';
echo '<th width="6">Fingers</th>';
echo '<th width="6">Legs</th>';
echo '<th width="6">Feet</th>';
echo '<th width="6">Primry</th>';
echo '<th width="6">Secdry</th>';
echo '<th width="6">Range</th>';
echo '<th width="6">Ammo</th>';
echo '<th width="6">Charm</th>';
echo '<th width="6">T2 Aug</th>';
echo '<th width="6">T3 Aug</th>';
echo '<th width="6">T5 Aug</th>';
echo '<th width="255">Mob</th>';
echo '<th width="4">BRD</th>';
echo '<th width="4">BST</th>';
echo '<th width="4">CLR</th>';
echo '<th width="4">DRU</th>';
echo '<th width="4">ENC</th>';
echo '<th width="4">MAG</th>';
echo '<th width="4">MNK</th>';
echo '<th width="4">NEC</th>';
echo '<th width="4">PAL</th>';
echo '<th width="4">RNG</th>';
echo '<th width="4">ROG</th>';
echo '<th width="4">SHD</th>';
echo '<th width="4">SHM</th>';
echo '<th width="4">WAR</th>';
echo '<th width="4">WIZ</th>';
echo '<th width="255">Notes</th>';
echo "</tr>";

while($row = mysql_fetch_array($result))
{
        echo "<tr>";
        echo "<td><input type=\"text\" id=\"id\" value={$row['id']}></td>";
        echo "<td>" . $row['soditemid'] . "</td>";
        echo "<td>" . $row['Tier'] . "</td>";
        echo "<td width=\"80\">" . $row['ItemName'] . "</td>";
        echo "<td>" . $row['AC'] . "</td>";
        echo "<td>" . $row['STR'] . "</td>";
        echo "<td>" . $row['STA'] . "</td>";
        echo "<td>" . $row['DEX'] . "</td>";
        echo "<td>" . $row['AGI'] . "</td>";
        echo "<td>" . $row['CHA'] . "</td>";
        echo "<td>" . $row['WIS'] . "</td>";
        echo "<td>" . $row['INT'] . "</td>";
        echo "<td>" . $row['HP'] . "</td>";
        echo "<td>" . $row['Mana'] . "</td>";
        echo "<td>" . $row['MR'] . "</td>";
        echo "<td>" . $row['FR'] . "</td>";
        echo "<td>" . $row['CR'] . "</td>";
        echo "<td>" . $row['PR'] . "</td>";
        echo "<td>" . $row['DR'] . "</td>";
        echo "<td>" . $row['FT'] . "</td>";
        echo "<td>" . $row['CS'] . "</td>";
        echo "<td>" . $row['MS'] . "</td>";
        echo "<td>" . $row['SR'] . "</td>";
        echo "<td>" . $row['DmgR'] . "</td>";
        echo "<td>" . $row['Aggr'] . "</td>";
        echo "<td>" . $row['SpellWard'] . "</td>";
        echo "<td>" . $row['Instrument'] . "</td>";
        echo "<td>" . $row['InstrumentMod'] . "</td>";
        echo "<td>" . $row['BaneType'] . "</td>";
        echo "<td>" . $row['BaneDmg'] . "</td>";
        echo "<td>" . $row['SkillMod'] . "</td>";
        echo "<td>" . $row['SkillModAmt'] . "</td>";
        echo "<td>" . $row['FocusEffect'] . "</td>";
        echo "<td>" . $row['SpellEffect'] . "</td>";
        echo "<td>" . $row['WeaponDmg'] . "</td>";
        echo "<td>" . $row['WeaponDly'] . "</td>";
        echo "<td>" . $row['WeaponType'] . "</td>";
        if($row['earslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['neckslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['headslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['faceslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['chestslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['backslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['armslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['shoulderslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['wristslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['waistslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['handslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['fingerslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['legslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['feetslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['prislot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['secslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['rangeslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['ammoslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['charmslot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['aug2slot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['aug3slot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['aug5slot'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        echo "<td>" . $row['mob'] . "</td>";
        if($row['brdclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['bstclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['clrclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['druclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['encclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['magclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['mnkclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['necclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['palclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['rngclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['rogclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['shdclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['shmclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['warclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        if($row['wizclass'] == "on") {
                echo "<td>" . "Y" . "</td>";
        }
        else {
                echo "<td>" . "N" . "</td>";
        }
        echo "<td>" . $row['notes'] . "</td>";
        echo "<td><input name=\"update\" type=\"submit\" value=\"Edit\"</td></tr>";
        var_dump( $row );
        
}
echo "</table>";
mysql_close($con);
?>

edit_form.php
Warning: Spoiler! (Click to show)
Code:
<?php
        $id = $_POST[id];
        mysql_connect("localhost", "username", "password");
        mysql_select_db("database_name") or die("Unable to select database");
        var_dump ( $_POST );
        echo ("SELECT * FROM Items WHERE id = {$id}"); // or die("Unable to search ID: " . mysql_error());
        $soditemid = $_POST['soditemid'];
    $tier = $_POST['tier'];
    $itemname = $_POST['itemname'];
    $itemac = $_POST['itemac'];
    $itemstr = $_POST['itemstr'];
    $itemsta = $_POST['itemsta'];
    $itemdex = $_POST['itemdex'];
    $itemagi = $_POST['itemagi'];
    $itemcha = $_POST['itemcha'];
    $itemwis = $_POST['itemwis'];
    $itemint = $_POST['itemint'];
    $itemhp = $_POST['itemhp'];
    $itemmana = $_POST['itemmana'];
    $itemmr = $_POST['itemmr'];
    $itemfr = $_POST['itemfr'];
    $itemcr = $_POST['itemcr'];
    $itempr = $_POST['itempr'];
    $itemdr = $_POST['itemdr'];
    $itemft = $_POST['itemft'];
    $itemcs = $_POST['itemcs'];
    $itemms = $_POST['itemms'];
    $itemsr = $_POST['itemsr'];
    $itemdmgr = $_POST['itemdmgr'];
    $itemaggr = $_POST['itemaggr'];
    $itemsw = $_POST['itemsw'];
    $instrument = $_POST['instrument'];
    $instrumentmod = $_POST['instrumentmod'];
    $banetype = $_POST['banetype'];
    $banedmg = $_POST['banedmg'];
    $skillmod = $_POST['skillmod'];
    $skillmodamt = $_POST['skillmodamt'];
    $focuseffect = $_POST['focuseffect'];
    $spelleffect = $_POST['spelleffect'];
    $weapondmg = $_POST['weapondmg'];
    $weapondly = $_POST['weapondly'];
    $weapontype = $_POST['weapontype'];
        $earslot = $_POST['earslot'];
        $neckslot = $_POST['neckslot'];
        $headslot = $_POST['headslot'];
        $faceslot = $_POST['faceslot'];
        $chestslot = $_POST['chestslot'];
        $backslot = $_POST['backslot'];
        $armslot = $_POST['armslot'];
        $shoulderslot = $_POST['shoulderslot'];
        $wristslot = $_POST['wristslot'];
        $waistslot = $_POST['waistslot'];
        $handslot = $_POST['handslot'];
        $fingerslot = $_POST['fingerslot'];
        $legslot = $_POST['legslot'];
        $feetslot = $_POST['feetslot'];
        $prislot = $_POST['prislot'];
        $secslot = $_POST['secslot'];
        $rangeslot = $_POST['rangeslot'];
        $ammoslot = $_POST['ammoslot'];
        $charmslot = $_POST['charmslot'];
        $aug2slot = $_POST['aug2slot'];
        $aug3slot = $_POST['aug3slot'];
        $aug5slot = $_POST['aug5slot'];
        $mob = $_POST['mob'];
    $brdclass = $_POST['brdclass'];
        $bstclass = $_POST['bstclass'];
        $clrclass = $_POST['clrclass'];
        $druclass = $_POST['druclass'];
        $encclass = $_POST['encclass'];
        $magclass = $_POST['magclass'];
        $mnkclass = $_POST['mnkclass'];
        $necclass = $_POST['necclass'];
        $palclass = $_POST['palclass'];
        $rngclass = $_POST['rngclass'];
        $rogclass = $_POST['rogclass'];
        $shdclass = $_POST['shdclass'];
        $shmclass = $_POST['shmclass'];
        $warclass = $_POST['warclass'];
        $wizclass = $_POST['wizclass'];
    $notes = $_POST['notes'];
        $result = mysql_query($query) or die($query . mysql_error());
        echo '<form action="update.php" method="post">';
        echo '<table border="2" width="5000" cellspacing="0" cellpadding="3">';
        echo "<tr>";
        echo '<th width="8">DBID</th>';
        echo '<th width="12">SoD Item ID</th>';
        echo '<th width="4">Tier</th>';
        echo '<th width="255">ItemName</th>';
        echo '<th width="4">AC</th>';
        echo '<th width="4">STR</th>';
        echo '<th width="4">STA</th>';
        echo '<th width="4">DEX</th>';
        echo '<th width="4">AGI</th>';
        echo '<th width="4">CHA</th>';
        echo '<th width="4">WIS</th>';
        echo '<th width="4">INT</th>';
        echo '<th width="4">HP</th>';
        echo '<th width="4">Mana</th>';
        echo '<th width="4">MR</th>';
        echo '<th width="4">FR</th>';
        echo '<th width="4">CR</th>';
        echo '<th width="4">PR</th>';
        echo '<th width="4">DR</th>';
        echo '<th width="6">FT</th>';
        echo '<th width="6">CrtStr</th>';
        echo '<th width="6">MdShld</th>';
        echo '<th width="6">StnRes</th>';
        echo '<th width="6">DmgRed</th>';
        echo '<th width="6">Aggr</th>';
        echo '<th width="6">SplWrd</th>';
        echo '<th width="12">Instrument</th>';
        echo '<th width="6">InsMod</th>';
        echo '<th width="12">BaneType</th>';
        echo '<th width="6">BneDmg</th>';
        echo '<th width="12">SkillMod</th>';
        echo '<th width="6">ModAmt</th>';
        echo '<th width="255">FocusEffect</th>';
        echo '<th width="255">SpellEffect</th>';
        echo '<th width="6">WpnDmg</th>';
        echo '<th width="6">WpnDly</th>';
        echo '<th width="6">WpnTyp</th>';
        echo '<th width="6">Ear</th>';
        echo '<th width="6">Neck</th>';
        echo '<th width="6">Head</th>';
        echo '<th width="6">Face</th>';
        echo '<th width="6">Chest</th>';
        echo '<th width="6">Back</th>';
        echo '<th width="6">Arms</th>';
        echo '<th width="6">Shldrs</th>';
        echo '<th width="6">Wrist</th>';
        echo '<th width="6">Waist</th>';
        echo '<th width="6">Hands</th>';
        echo '<th width="6">Fingers</th>';
        echo '<th width="6">Legs</th>';
        echo '<th width="6">Feet</th>';
        echo '<th width="6">Primry</th>';
        echo '<th width="6">Secdry</th>';
        echo '<th width="6">Range</th>';
        echo '<th width="6">Ammo</th>';
        echo '<th width="6">Charm</th>';
        echo '<th width="6">T2 Aug</th>';
        echo '<th width="6">T3 Aug</th>';
        echo '<th width="6">T5 Aug</th>';
        echo '<th width="255">Mob</th>';
        echo '<th width="4">BRD</th>';
        echo '<th width="4">BST</th>';
        echo '<th width="4">CLR</th>';
        echo '<th width="4">DRU</th>';
        echo '<th width="4">ENC</th>';
        echo '<th width="4">MAG</th>';
        echo '<th width="4">MNK</th>';
        echo '<th width="4">NEC</th>';
        echo '<th width="4">PAL</th>';
        echo '<th width="4">RNG</th>';
        echo '<th width="4">ROG</th>';
        echo '<th width="4">SHD</th>';
        echo '<th width="4">SHM</th>';
        echo '<th width="4">WAR</th>';
        echo '<th width="4">WIZ</th>';
        echo "</tr>";
        echo "<tr>";
        while($row = mysql_fetch_array($result)) {
        echo "<td><input type=\"text\" name=\"id\" size=6 readonly=\"true\" value=\"$row[id]\"</td>";
        echo "<td><input type=\"number\" name=\"soditemid\" size=6 value=\"$row[soditemid]\"</td>";
        echo "<td><input type=\"number\" name=\"tier\" size=5 value=\"$row[Tier]\"</td>";
        echo "<td><input type=\"text\" name=\"itemname\" size=80 value=\"$row[ItemName]\"</td>";
        echo "<td><input type=\"number\" name=\"itemac\" size=5 value=\"$row[AC]\"</td>";
        echo "<td><input type=\"number\" name=\"itemstr\" size=5 value=\"$row[STR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemsta\" size=5 value=\"$row[STA]\"</td>";
        echo "<td><input type=\"number\" name=\"itemdex\" size=5 value=\"$row[DEX]\"</td>";
        echo "<td><input type=\"number\" name=\"itemagi\" size=5 value=\"$row[AGI]\"</td>";
        echo "<td><input type=\"number\" name=\"itemcha\" size=5 value=\"$row[CHA]\"</td>";
        echo "<td><input type=\"number\" name=\"itemwis\" size=5 value=\"$row[WIS]\"</td>";
        echo "<td><input type=\"number\" name=\"itemint\" size=5 value=\"$row[INT]\"</td>";
        echo "<td><input type=\"number\" name=\"itemhp\" size=5 value=\"$row[HP]\"</td>";
        echo "<td><input type=\"number\" name=\"itemmana\" size=5 value=\"$row[Mana]\"</td>";
        echo "<td><input type=\"number\" name=\"itemmr\" size=5 value=\"$row[MR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemfr\" size=5 value=\"$row[FR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemcr\" size=5 value=\"$row[CR]\"</td>";
        echo "<td><input type=\"number\" name=\"itempr\" size=5 value=\"$row[PR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemdr\" size=5 value=\"$row[DR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemft\" size=5 value=\"$row[FT]\"</td>";
        echo "<td><input type=\"number\" name=\"itemcs\" size=5 value=\"$row[CS]\"</td>";
        echo "<td><input type=\"number\" name=\"itemms\" size=5 value=\"$row[MS]\"</td>";
        echo "<td><input type=\"number\" name=\"itemsr\" size=5 value=\"$row[SR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemdmgr\" size=5 value=\"$row[DmgR]\"</td>";
        echo "<td><input type=\"number\" name=\"itemaggr\" size=5 value=\"$row[Aggr]\"</td>";
        echo "<td><input type=\"number\" name=\"itemsw\" size=5 value=\"$row[SpellWard]\"</td>";
        echo "<td><input type=\"text\" name=\"instrument\" size=15 value=\"$row[Instrument]\"</td>";
        echo "<td><input type=\"number\" name=\"instrumentmod\" size=5 value=\"$row[InstrumentMod]\"</td>";
        echo "<td><input type=\"text\" name=\"banetype\" size=15 value=\"$row[BaneType]\"</td>";
        echo "<td><input type=\"number\" name=\"banedmg\" size=5 value=\"$row[BaneDmg]\"</td>";
        echo "<td><input type=\"text\" name=\"skillmod\" size=15 value=\"$row[SkillMod]\"</td>";
        echo "<td><input type=\"number\" name=\"skillmodamt\" size=5 value=\"$row[SkillModAmt]\"</td>";
        echo "<td><input type=\"text\" name=\"focuseffect\" size=80 value=\"$row[FocusEffect]\"</td>";
        echo "<td><input type=\"text\" name=\"spelleffect\" size=80 value=\"$row[SpellEffect]\"</td>";
        echo "<td><input type=\"number\" name=\"weapondmg\" size=5 value=\"$row[WeaponDmg]\"</td>";
        echo "<td><input type=\"number\" name=\"weapondly\" size=5 value=\"$row[WeaponDly]\"</td>";
        echo "<td><input type=\"text\" name=\"weapontype\" size=15 value=\"$row[WeaponType]\"</td>";
?>
<td><input type="checkbox" name="earslot" <? echo ($row['earslot'] ? 'checked="checked"' : ''); ?> /></td>
<td><input type="checkbox" name="neckslot" <? echo ($row['neckslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="headslot" <? echo ($row['headslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="faceslot" <? echo ($row['faceslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="chestslot" <? echo ($row['chestslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="backslot" <? echo ($row['backslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="armslot" <? echo ($row['armslot'] ? 'checked="checked"' : ''); ?>/></td>
<td><input type="checkbox" name="shoulderslot" echo <? ($row['shoulderslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="wristslot" <? echo ($row['wristslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="waistslot" <? echo ($row['waistslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="handslot" <? echo ($row['handslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="fingerslot" <? echo ($row['fingerslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="legslot" <? echo ($row['legslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="feetslot" <? echo ($row['feetslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="prislot" <? echo ($row['prislot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="secslot" <? echo ($row['secslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="rangeslot" <? echo ($row['rangeslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="ammoslot" <? echo ($row['ammoslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="charmslot" <? echo ($row['charmslot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="aug2slot" <? echo ($row['aug2slot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="aug3slot" <? echo ($row['aug3slot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="aug5slot" <? echo ($row['aug5slot'] ? 'checked=\"checked\"' : ''); ?>/></td>
<? echo "<td><input type=\"text\" name=\"mob\" size=80 value=\"$row[mob]\"</td>"; ?>
<td><input type="checkbox" name="brdclass" <? echo ($row[brdclass] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="bstclass" <? echo ($row['bstclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="clrclass" <? echo ($row['clrclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="druclass" <? echo ($row['druclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="encclass" <? echo ($row['encclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="magclass" <? echo ($row['magclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="mnkclass" <? echo ($row['mnkclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="necclass" <? echo ($row['necclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="palclass" <? echo ($row['palclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="rngclass" <? echo ($row['rngclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="rogclass" <? echo ($row['rogclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="shdclass" <? echo ($row['shdclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="shmclass" <? echo ($row['shmclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="warclass" <? echo ($row['warclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="checkbox" name="wizclass" <? echo ($row['wizclass'] ? 'checked=\"checked\"' : ''); ?>/></td>
<td><input type="text" name="notes" size="255" value="<? echo($row['notes']); ?>"/></td>


<td><input name="update" type="submit" value="Update"</td>
</tr>
<?
}
?>
</form>
</table>

Edited by Iggy0828 - 9/28/12 at 3:51am
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
Speedy
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 EX58-UD4P NVIDIA GeForce GTX 285 Corsair  
Hard DriveCoolingOSMonitor
Seagate Barracuda CM Hyper 212+ Ubuntu 12.04 w/KDE 25.6" Hanns-G 
KeyboardPowerCaseMouse
Saitek Eclipse II Corsair 750 Watt Antec 902 Logitech Wireless Trackball 
  hide details  
Reply
post #10 of 24
Code:
echo "<td><input name=\"update\" type=\"submit\" value=\"Edit\"</td></tr>";

Change to:
Code:
echo "<td><input name=\"update\" type=\"submit\" value=\"Edit\" /></td></tr>";

Code:
<td><input name="update" type="submit" value="Update"</td>

Change to:
Code:
<td><input name="update" type="submit" value="Update" /></td>

Code:
$id = $_POST[id];

Change to:
Code:
$id = $_POST['id'];

Strange your $_POST output did not have the value for the ID field, though...
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding