my update script is so sensitive! i am using a mysql query to dispaly th evarious fields using $row["1"] etc etc
now, if someone goes to the update page and does not hit update.... their information is deleted from the database... yet i'm not using it to delete anything? only grab the rows and update them
which it does but if you do not hit update when you get there at some poitn and you move on everything get's erased 🙁
any ideas?
<?
//line 173
include("db.php");
$id = 59;
$query2 = "SELECT * FROM users WHERE username='" . $_GET["username"] . "'";
$result = mysql_query($query2);
$row = mysql_fetch_row($result);
$query = "UPDATE users SET username='$username',
Year='$Year',
Color='$Color',
Custom_color='$Custum_color',
Model='$Model',
Engine='$Engine',
FI='$FI',
Wheels='$Wheels',
Tires='$Tires',
Hood='$Hood',
Fenders='$Fenders',
Body_kit='$Body_kit',
Front_bumper='$Body_kit',
Grill_insert='$Grill_insert',
Sides='$Sides',
Rear_bumper='$Rear_bumper',
exteriormods='$exteriormods',
interiormods='$interiormods',
suspensionmods='$suspensionmods',
performancemods='$performancemods',
audiomods='$audiomods' ,
Coming_mods='$Coming_mods',
exteriorneons='$exteriorneons',
interiorneons='$interiorneons',
Transmission='$Transmission',
Wing='$Wing'
WHERE username='" . $_GET["username"] . "'";;
mysql_query($query);
if ($submit) {
print ("<TABLE borderColor=\"#000000\" cellSpacing=0 width=\"90%\" bgColor=\"#000000\" border=1><tbody>");
print ("<tr><td>Your Profile has been updated!</td></tr><tr><td background=\"background2.gif\">To go back to your profile and edit it again, DO NOT USE THE BACK BUTTON! <a href=\"http://www.dv6cougar.com/login/login.php\">click here</a></td></tr>");
print ("</tbody></table>");
?>
<P> </P>
<?
}
else
{
?>
<form method="post" action="update3.php?username=<? echo $row["1"]; ?>">
<TABLE borderColor=#000000 cellSpacing=0 width="90%" bgColor=#000000
border=1 background="Welcome_files/background2.gif">
<TBODY>
<td>Username:</td>
<td align="center">
<input type="text" name="username" value="<? echo $row["1"]; ?>"></td></tr>
<tr><td>Year:</td><td align="center"><select name="Year">
<option selected value="<? echo $row["2"]; ?>"></option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
</select></td></tr><!--goes on from here-->
thank you all
oh ya, before this it is passed through a link so the page loads as update3.php?username=$username
and that does work fine too
but why is it doing this? 🙁
I tried putting if ($submit) { up farther, above UPDATE FROM and it didn't do anything anymore at all
thanks again