Ok, I tried this, but I get an error now:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in edit_equipment.php on line 13
Here is what I have so far, and it didn't populate the name into the field like I thought it would... :
Code:
<?php
include("lib.php");
define("PAGENAME", "Edit Equipment");
if ($player->access < 100)
$msg1 = "<font color=\"red\">"; //name error?
$error = 0;
$query = $db->execute("SELECT * FROM `items` WHERE `id`=?", array($_POST['id']));
$result = mysql_query($query);
$data = mysql_fetch_assoc($result);
$msg1 .= "</font>"; //name error?
?>
<?=$could_not_register?>
<h2 align="center"><strong>Item Creator:</strong></h2>
<form method="post" action="edit_equipment.php">
<table width="86%" border="0">
<tr>
<td>
<label>
Name</label>
</td>
<td><label><input type="text" name="name" value="<?php echo $data['name']; ?>">
</label>
<-- Name of Item
<?=$msg1;?></td>
</tr>
</table>
<?=$msg2;?>
<input type="submit" name="register" value="Create Item!">
<input type="reset" value="Reset Fields">
</form>