PDA

View Full Version : SQL Error on ranks "doupdate"


Duckface
04-25-2015, 08:52 PM
Hiya,

When editing a rank on admincp I'm getting this sql error:


Database error in vBulletin 4.2.2:

Invalid SQL:

UPDATE ranks
SET ranklevel = 1,
minposts = 0,
rankimg = 'images/ranksets/1.png',
usergroupid = -1,
type = 0,
stack = 0,
display = 0,
WHERE rankid = 11;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE rankid = 11' at line 9
Error Number : 1064
Request Date : Saturday, April 25th 2015 @ 10:48:53 PM
Error Date : Saturday, April 25th 2015 @ 10:48:53 PM
Script : http://spawnscape614.co.uk/forums/admincp/ranks.php?do=doupdate
Referrer : http://spawnscape614.co.uk/forums/admincp/ranks.php?do=edit&rankid=11
IP Address : 141.101.99.22
Username : Shekii
Classname : vB_Database
MySQL Version : 5.5.42-cll

*The ip is cloudflare so.

I looked into the ranks.php within the admincp and checked the doupdate and its currently this:


if ($_POST['do'] == 'doupdate')
{
$vbulletin->input->clean_array_gpc('p', array(
'ranklevel' => TYPE_UINT,
'minposts' => TYPE_UINT,
'rankimg' => TYPE_STR,
'usergroupid' => TYPE_INT,
'doinsert' => TYPE_STR,
'rankhtml' => TYPE_NOTRIM,
'stack' => TYPE_UINT,
'display' => TYPE_UINT,
));


Is anything wrong with this?

Checking phpmyadmin to see what columns that I have:

https://vborg.vbsupport.ru/external/2015/04/4.png

Could anyone help me?

--------------- Added 1430002527 at 1430002527 ---------------

Never mind, fixed. Resolved by myself.

ForceHSS
04-25-2015, 09:00 PM
It will not allow you to have usergroupid = -1 it needs to be whatever group id you have set in ranks if you have set it at -1 then you need to change that