The code was originally this
PHP Code:
$vbulletin->input->clean_gpc("p","userbarid",TYPE_INT);
$userbarresult=$db->query_read("SELECT userbarid FROM ".TABLE_PREFIX."userbar WHERE userbarid='".$vbulletin->GPC['userbarid']."'");
if(!$db->num_rows($userbarresult)){
eval(standard_error(fetch_error('unvalid_userbar')));
}
$db->query_write("UPDATE ".TABLE_PREFIX."user SET userbar='".$vbulletin->GPC['userbarid']."' WHERE userid='".$vbulletin->userinfo['userid']."'");
$vbulletin->url = 'usercp.php' . $vbulletin->session->vars['sessionurl_q'];
eval(print_standard_redirect('redirect_userbarselected'));
I changed it to this
PHP Code:
$vbulletin->input->clean_gpc("p","userbarid",TYPE_INT);
$userbarresult=$db->query_read("SELECT userbarid FROM ".TABLE_PREFIX."userbar WHERE userbarid='".$vbulletin->GPC['userbarid']."'");
$vbulletin->input->clean_gpc("p","userbarpath",TYPE_VARCHAR);
$userbarresult=$db->query_read("SELECT userbarpath FROM ".TABLE_PREFIX."userbar WHERE userbarpath='".$vbulletin->GPC['userbarpath']."'");
if(!$db->num_rows($userbarresult)){
eval(standard_error(fetch_error('unvalid_userbar')));
}
$db->query_write("UPDATE ".TABLE_PREFIX."user SET userbar='".$vbulletin->GPC['userbarid']."' WHERE userid='".$vbulletin->userinfo['userid']."'");
$vbulletin->url = 'usercp.php' . $vbulletin->session->vars['sessionurl_q'];
eval(print_standard_redirect('redirect_userbarselected'));
$db->query_write("UPDATE ".TABLE_PREFIX."user SET userbarpath='".$vbulletin->GPC['userbarpath']."' WHERE userbarpath='".$vbulletin->userinfo['userbarpath']."'");
$vbulletin->url = 'usercp.php' . $vbulletin->session->vars['sessionurl_q'];
eval(print_standard_redirect('redirect_userbarselected'));
I don't know anything about coding, but I'm trying to grab another set of data called userbarpath and insert it into the user table. I get an error that says userbar does not exist when I try.. can someone please tell me why I'm doing wrong?