CoolAsCarlito
03-17-2010, 08:50 PM
However its not posting anything to the DB now and don't know why.
case 3:
echo $e;
$query = "SELECT s.hometown, s.height, s.weight,
h.kowtitles, h.kowawards,
w.nicknames, w.finisher, w.setup, w.music
FROM `efed_bio_singles` AS s,
`efed_bio_history` AS h,
`efed_bio_wrestling` AS w
WHERE s.bio_id = '$defaultcharacterid' AND
h.bio_id = '$defaultcharacterid' AND
w.bio_id = '$defaultcharacterid'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$height = mysql_real_escape_string($height);
?>
<h1 class=backstage>Character Management</h1><br />
<h2 class=backstage><?php echo $defaultcharactername; ?> - Personal</h2><br />
<form name="editcharacter" method="post">
<input type="hidden" name="action" value="character" />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>Hometown:</td><td class=row3>
<input type=text name="hometown" class=fieldtext490 value="<?php echo $row['hometown']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Height:</td><td class=row3>
<input type=text name="height" class=fieldtext40 value="<?php echo htmlspecialchars($row['height']); ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Weight:</td><td class=row3>
<input type=text name="weight" class=fieldtext80 value="<?php echo $row['weight']; ?>"></td>
</tr>
</table><br />
<h2 class=backstage>KOW Related</h2><br />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>KOW Titles:</td><td class=row3>
<input type=text name="kowtitles" class=fieldtext490 value="<?php echo $row['kowtitles']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>KOW Awards:</td><td class=row3>
<input type=text name="kowawards" class=fieldtext490 value="<?php echo $row['kowawards']; ?>"></td>
</tr>
</table><br />
<h2 class=backstage>Wrestling</h2><br />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>Nicknames:</td><td class=row3>
<input type=text name="nicknames" class=fieldtext490 value="<?php echo $row['nicknames']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Manager:</td><td class=row3>
<select name="managerid" class=dropdown>
<option value="0">- Select -</option>
<?php
$query = 'SELECT charactername,id FROM `efed_bio` WHERE `style_id`= 3';
$result = mysql_query ( $query );
while ( $manager_row = mysql_fetch_assoc ( $result ) )
{
print "<option value=\"".$manager_row['id']."\" ";
if($manager_row['id'] == $row['manager_id']) {
print " SELECTED";
}
print ">".$manager_row['charactername']."</option>\r";
}
?>
</select></td>
</tr>
<tr>
<td width=120 class=rowheading>Finisher Move:</td><td class=row3>
<input type=text name="finisher" class=fieldtext490 value="<?php echo $row['finisher']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Setup Move:</td><td class=row3>
<input type=text name="setup" class=fieldtext490 value="<?php echo $row['setup']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Entrance Music:</td><td class=row3>
<input type=text name="music" class=fieldtext490 value="<?php echo $row['music']; ?>"></td>
</tr>
</table><br />
<input type="hidden" name="defaultcharacterid" value="<?php echo $row['defaultcharacterid']; ?>">
<input type="hidden" name="editted2" value="true">
<input type=submit value="Update Bio" class=button></form><br />
<?php
returnmain();
break;
Here's the query I"m running with it.
if ((!empty($_POST['editted2']))) {
$kowtitles = mysql_real_escape_string($_POST['kowtitles']);
$kowawards = mysql_real_escape_string($_POST['kowawards']);
$height = mysql_real_escape_string($_POST['height']);
$weight = mysql_real_escape_string($_POST['weight']);
$hometown = mysql_real_escape_string($_POST['hometown']);
$managerid = mysql_real_escape_string($_POST['managerid']);
$nicknames = mysql_real_escape_string($_POST['nicknames']);
$finisher = mysql_real_escape_string($_POST['finisher']);
$setup = mysql_real_escape_string($_POST['setup']);
$music = mysql_real_escape_string($_POST['music']);
$defaultcharacterid = mysql_real_escape_string($_POST['defaultcharacterid']);
$query = "UPDATE `efed_bio_history` SET `kowtitles` = '".$kowtitles."', `kowawards` = '".$kowawards."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query)){ echo mysql_error() . "<br />" . $query;}
echo $query;
$query2 = "UPDATE `efed_bio_singles` SET `height` = '".$height."', `hometown` = '".$hometown."', `weight` = '".$weight."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query2)){ echo mysql_error() . "<br />" . $query2;}
echo $query2;
$query3 = "UPDATE `efed_bio_wrestling` SET `manager_id` = '".$managerid."', `nicknames` = '".$nicknames."', `finisher` = '".$finisher."', `setup` = '".$setup."', `music` = '".$music."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query3)){ echo mysql_error() . "<br />" . $query3;}
echo $query3;
}
With the echoed query it says :
UPDATE `efed_bio_history` SET `kowtitles` = 'Testing', `kowawards` = 'Testing' WHERE `bio_id` = ''UPDATE `efed_bio_singles` SET `height` = '5\\\'4\\\"', `hometown` = 'Tokoyo, Japan', `weight` = '145 lbs.' WHERE `bio_id` = ''UPDATE `efed_bio_wrestling` SET `manager_id` = '0', `nicknames` = 'Testing', `finisher` = 'Testing', `setup` = 'testing', `music` = 'testing' WHERE `bio_id` = ''
Which means something is wrong with it getting the defaultcharacterid but I passed it correctly with the hidden field.
case 3:
echo $e;
$query = "SELECT s.hometown, s.height, s.weight,
h.kowtitles, h.kowawards,
w.nicknames, w.finisher, w.setup, w.music
FROM `efed_bio_singles` AS s,
`efed_bio_history` AS h,
`efed_bio_wrestling` AS w
WHERE s.bio_id = '$defaultcharacterid' AND
h.bio_id = '$defaultcharacterid' AND
w.bio_id = '$defaultcharacterid'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$height = mysql_real_escape_string($height);
?>
<h1 class=backstage>Character Management</h1><br />
<h2 class=backstage><?php echo $defaultcharactername; ?> - Personal</h2><br />
<form name="editcharacter" method="post">
<input type="hidden" name="action" value="character" />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>Hometown:</td><td class=row3>
<input type=text name="hometown" class=fieldtext490 value="<?php echo $row['hometown']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Height:</td><td class=row3>
<input type=text name="height" class=fieldtext40 value="<?php echo htmlspecialchars($row['height']); ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Weight:</td><td class=row3>
<input type=text name="weight" class=fieldtext80 value="<?php echo $row['weight']; ?>"></td>
</tr>
</table><br />
<h2 class=backstage>KOW Related</h2><br />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>KOW Titles:</td><td class=row3>
<input type=text name="kowtitles" class=fieldtext490 value="<?php echo $row['kowtitles']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>KOW Awards:</td><td class=row3>
<input type=text name="kowawards" class=fieldtext490 value="<?php echo $row['kowawards']; ?>"></td>
</tr>
</table><br />
<h2 class=backstage>Wrestling</h2><br />
<table width="100%" class="table2">
<tr>
<td width=120 class=rowheading>Nicknames:</td><td class=row3>
<input type=text name="nicknames" class=fieldtext490 value="<?php echo $row['nicknames']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Manager:</td><td class=row3>
<select name="managerid" class=dropdown>
<option value="0">- Select -</option>
<?php
$query = 'SELECT charactername,id FROM `efed_bio` WHERE `style_id`= 3';
$result = mysql_query ( $query );
while ( $manager_row = mysql_fetch_assoc ( $result ) )
{
print "<option value=\"".$manager_row['id']."\" ";
if($manager_row['id'] == $row['manager_id']) {
print " SELECTED";
}
print ">".$manager_row['charactername']."</option>\r";
}
?>
</select></td>
</tr>
<tr>
<td width=120 class=rowheading>Finisher Move:</td><td class=row3>
<input type=text name="finisher" class=fieldtext490 value="<?php echo $row['finisher']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Setup Move:</td><td class=row3>
<input type=text name="setup" class=fieldtext490 value="<?php echo $row['setup']; ?>"></td>
</tr>
<tr>
<td width=120 class=rowheading>Entrance Music:</td><td class=row3>
<input type=text name="music" class=fieldtext490 value="<?php echo $row['music']; ?>"></td>
</tr>
</table><br />
<input type="hidden" name="defaultcharacterid" value="<?php echo $row['defaultcharacterid']; ?>">
<input type="hidden" name="editted2" value="true">
<input type=submit value="Update Bio" class=button></form><br />
<?php
returnmain();
break;
Here's the query I"m running with it.
if ((!empty($_POST['editted2']))) {
$kowtitles = mysql_real_escape_string($_POST['kowtitles']);
$kowawards = mysql_real_escape_string($_POST['kowawards']);
$height = mysql_real_escape_string($_POST['height']);
$weight = mysql_real_escape_string($_POST['weight']);
$hometown = mysql_real_escape_string($_POST['hometown']);
$managerid = mysql_real_escape_string($_POST['managerid']);
$nicknames = mysql_real_escape_string($_POST['nicknames']);
$finisher = mysql_real_escape_string($_POST['finisher']);
$setup = mysql_real_escape_string($_POST['setup']);
$music = mysql_real_escape_string($_POST['music']);
$defaultcharacterid = mysql_real_escape_string($_POST['defaultcharacterid']);
$query = "UPDATE `efed_bio_history` SET `kowtitles` = '".$kowtitles."', `kowawards` = '".$kowawards."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query)){ echo mysql_error() . "<br />" . $query;}
echo $query;
$query2 = "UPDATE `efed_bio_singles` SET `height` = '".$height."', `hometown` = '".$hometown."', `weight` = '".$weight."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query2)){ echo mysql_error() . "<br />" . $query2;}
echo $query2;
$query3 = "UPDATE `efed_bio_wrestling` SET `manager_id` = '".$managerid."', `nicknames` = '".$nicknames."', `finisher` = '".$finisher."', `setup` = '".$setup."', `music` = '".$music."' WHERE `bio_id` = '".$defaultcharacterid."'";
if(!mysql_query($query3)){ echo mysql_error() . "<br />" . $query3;}
echo $query3;
}
With the echoed query it says :
UPDATE `efed_bio_history` SET `kowtitles` = 'Testing', `kowawards` = 'Testing' WHERE `bio_id` = ''UPDATE `efed_bio_singles` SET `height` = '5\\\'4\\\"', `hometown` = 'Tokoyo, Japan', `weight` = '145 lbs.' WHERE `bio_id` = ''UPDATE `efed_bio_wrestling` SET `manager_id` = '0', `nicknames` = 'Testing', `finisher` = 'Testing', `setup` = 'testing', `music` = 'testing' WHERE `bio_id` = ''
Which means something is wrong with it getting the defaultcharacterid but I passed it correctly with the hidden field.