Been on this a couple of hours... anyone see what I'm doing wrong?
I get a result of 1 when I echo $result but it doesn't want to update at
all.
The action of this form index.php?action=update-account is just a switch
case 
Which asks you to use the function update_subscriber_account() below...

<form method='post' action='index.php?action=update-account'>
   <input type='hidden' name='old_id' value='$email'>
   <tr>
     <th colspan = 2 bgcolor = '#5B69A6'>
        $title 
     </th>
   </tr>
   <tr>
     <td>Real Name:</td>
     <td><input type = text name='new_realname' maxlength = 100 
          value ='$realname'></td>
   </tr>
   <tr>
     <td>Preferred Name:</td>
     <td><input type = text name='new_nickname' maxlength = 100 
          value ='$nickname'></td>
   </tr>
   <tr>
     <td>Company:</td>
     <td><input type = text name='new_company' maxlength = 100 
          value ='$company'></td>
   </tr>
   <tr>
     <td>Email Address:</td>
     <td><input type = text name='new_email' maxlength = 100 
          value ='$email'></td>
   </tr>
   <tr>
     <td>Requested Email Format:</td>";
     echo "<td><select name='new_mimetype'><option"; 
       if ($mimetype == 'T') 
          echo " selected";
       echo ">Text Only<option";
       if ($mimetype == 'H') 
          echo " selected";
       echo ">HTML</select></td>";
    print "</tr>
        <tr>
                <td colspan=2 align=center>";
    display_form_button('save-changes');
    print "</td></tr></form></table></center><br>";
        }
}

function update_subscriber_account()
{

db_connect();
$query = "update subscribers 
                        set email = '$new_email',
                        nickname = '$new_nickname',
                        fullname = '$new_realname',
                        company = '$new_company',
                        mimetype = '$new_mimetype'
                        where email = '$old_id'";
$result = mysql_query($query)or die("Error: Could not update
query<BR>$query<BR>".mysql_error());
if (!$result)
        {
        echo "An error occurred when trying to update the DB";
        }
        else
        {
        echo "$result & Successfully updated the details";
        }
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to