![]() |
|
Thread Tools |
#1
|
||||||||
|
||||||||
$var = $var unexpected result
I run a vBulletin plugin that has always worked fine until recently i upgraded Apache and PHP from 5.4 to 5.5 and suddonly a calculation isnt working the way it should do:
Instead of $RuserMinus being the result of $Ruser -1 it's replacing the value with -1 so $RUserMinus = "-1" instead of the result. FULL SCRIPT
No members have liked this post.
Last edited by TopFloorDjs; 18 Mar 2017 at 14:57. |
#2
|
|||
|
|||
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com Contact me for custom vBulletin 3/4 work & server/website management. No members have liked this post.
|
#3
|
||||
|
||||
No members have liked this post.
|
#4
|
||||
|
||||
Try putting the statement:
within the while loop. ![]()
__________________
Former vBulletin.org Staff Member ![]() Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons No members have liked this post.
|
#5
|
||||
|
||||
Database Error
]]> Database error in vBulletin 4.2.3 Invalid SQL: UPDATE user SET reputation= WHERE userid=2; 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 userid=2' at line 1 Error Number : 1064 Request Date : Saturday, March 18th 2017 @ 03:37:01 PM Error Date : Saturday, March 18th 2017 @ 03:37:01 PM Script : http://literecords.com/sandbox/post_thanks.php Referrer : http://literecords.com/sandbox/showt...php?2-rep-test Classname : vB_Database_MySQLi MySQL Version : 5.5.54-cll ]]> No members have liked this post.
|
#6
|
||||||||
|
||||||||
Rather than use a db query to get the browsing user's reputation, I would simply use:
Thus, your code becomes:
__________________
Former vBulletin.org Staff Member ![]() Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons No members have liked this post.
|
#7
|
||||||||||||
|
||||||||||||
Im not sure if that work as i use 2 queries in the full plugin script is:
--------------- Added 18 Mar 2017 at 15:56 --------------- AHHHH it f*cking works!! You absolute legend! Do you make music? I'll give you a privileged account haha! --------------- Added 18 Mar 2017 at 15:59 --------------- When i did it for the -1 part it worked great but when i adapted to the +1 part it give me the same database error as earlier ^^
--------------- Added 18 Mar 2017 at 16:05 ---------------
I think i see the problem. This line grabs the replying member's reputation. I need to find the thread starter's reputation. --------------- Added 18 Mar 2017 at 16:08 --------------- It's deducting -1 from thread starter's reputation instead of +1 No members have liked this post.
Last edited by TopFloorDjs; 18 Mar 2017 at 16:09. |
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 08:53.