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!
You are not logged in. Please login or register.
PunBB Forums → Programming → 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!
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());
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
Thanks Rickard, your forums are amazing!
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.
$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 :\
form[charname] I think (for the <input> name attribute)
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']).'">
?
sounds right
Worked, thanks a lot!
PS: Take a look at my thread in "Show Off" to see what you guys helped me accomplish!!
PunBB Forums → Programming → Profile.php problem
Powered by PunBB, supported by Informer Technologies, Inc.