Topic: Profile.php problem

I added some fields, but I can't find where the script updates the values in the DB.  I have looked at every "UPDATE" query in the file, and can't seem to find it.  I have run out of ideas, and would appreciate some help!

Re: Profile.php problem

It starts at

else if (isset($_POST['form_sent']))

and then the profile is updated at

$db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Profile.php problem

how would I make it add my fields to the DB?  I don't see where I would add them on that quey.  Could I just write another "traditional" query?  I don't know what the implode is lol tongue

Thanks Rickard, your forums are amazing!  big_smile

Re: Profile.php problem

That depends on to which section of the profile you added the new fields. Between the two pieces of code I posted above, you will find a big switch(). In each case of this switch, you will find a line that looks something like this:

$form = extract_elements(array('timezone', 'language'));

This one is from the "essentials" section. If you've added a new field to that section that's called 'occupation', you would just add that name to the end of the array of elements. I.e.

$form = extract_elements(array('timezone', 'language', 'occupation'));

That should do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Profile.php problem

$charnameBox = '<p><input name="charname" type="text" id="charname" maxlength="15"'.' value="'.pun_htmlspecialchars($user['charname']).'"></p>';

                case 'essentials':
                {
                        $form = extract_elements(array('timezone', 'language', 'charname', 'picurl', 'charinpic', 'game'));

Any idea what's wrong?  The value isn't getting updated for some reason :\

6 (edited by Smartys 2005-09-19 22:39)

Re: Profile.php problem

form[charname] I think (for the <input> name attribute) wink

Re: Profile.php problem

So change this : <input name="charname" type="text" id="charname" maxlength="15"'.' value="'.pun_htmlspecialchars($user['charname']).'">

To This: <input name="form[charname]" type="text" id="charname" maxlength="15"'.' value="'.pun_htmlspecialchars($user['charname']).'">

?

Re: Profile.php problem

sounds right

9 (edited by RuDeDoGg 2005-09-20 04:17)

Re: Profile.php problem

Worked, thanks a lot!  big_smile

PS:  Take a look at my thread in "Show Off" to see what you guys helped me accomplish!!